mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Python: Fix up OsGuard class.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
| 34 | BasicBlock | Linux |
|
||||
| 68 | BasicBlock | Windows |
|
||||
8
python/ql/test/library-tests/PointsTo/version/OSGuard.ql
Normal file
8
python/ql/test/library-tests/PointsTo/version/OSGuard.ql
Normal 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()
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user