Python: Fix up OsGuard class.

This commit is contained in:
Mark Shannon
2019-03-07 14:21:03 +00:00
parent b3d935063f
commit ef1c08e351
4 changed files with 22 additions and 8 deletions

View File

@@ -0,0 +1,2 @@
| 34 | BasicBlock | Linux |
| 68 | BasicBlock | Windows |

View File

@@ -0,0 +1,8 @@
import python
import semmle.python.types.Version
from OsGuard og, Location l
where l = og.getLastNode().getLocation() and
l.getFile().getName().matches("%test.py")
select l.getStartLine(), og.toString(), og.getOs()

View File

@@ -11,7 +11,7 @@ import sys
os_test = sys.platform == "linux"
os_test = sys.platform == "win32"
version_test = sys.version_info < (3,)
from module import os_test as t2
@@ -64,3 +64,7 @@ Py2f = sys.version_info[:2] < (2,7)
#From problem_report
Py2g = sys.version[0] < '3'
Py3h = sys.version[0] >= '3'
if os_test:
pass