mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Python: Add PEP-328 test example
Based on https://www.python.org/dev/peps/pep-0328/#guido-s-decision Original "code" is in the Public Domain.
This commit is contained in:
1
python/ql/test/experimental/dataflow/pep_328/__init__.py
Normal file
1
python/ql/test/experimental/dataflow/pep_328/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
bar = "bar"
|
||||
@@ -0,0 +1 @@
|
||||
foo = "foo"
|
||||
@@ -0,0 +1,16 @@
|
||||
from .moduleY import spam
|
||||
from .moduleY import spam as ham
|
||||
from . import moduleY
|
||||
from ..subpackage1 import moduleY
|
||||
from ..subpackage2.moduleZ import eggs
|
||||
from ..moduleA import foo
|
||||
|
||||
try:
|
||||
from ...package import bar
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
try:
|
||||
from ...sys import path
|
||||
except Exception as e:
|
||||
print(e)
|
||||
@@ -0,0 +1,16 @@
|
||||
from .moduleY import spam
|
||||
from .moduleY import spam as ham
|
||||
from . import moduleY
|
||||
from ..subpackage1 import moduleY
|
||||
from ..subpackage2.moduleZ import eggs
|
||||
from ..moduleA import foo
|
||||
|
||||
try:
|
||||
from ...package import bar
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
try:
|
||||
from ...sys import path
|
||||
except Exception as e:
|
||||
print(e)
|
||||
@@ -0,0 +1 @@
|
||||
spam = "spam"
|
||||
@@ -0,0 +1 @@
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
eggs = "eggs"
|
||||
1
python/ql/test/experimental/dataflow/pep_328/start.py
Normal file
1
python/ql/test/experimental/dataflow/pep_328/start.py
Normal file
@@ -0,0 +1 @@
|
||||
import package.subpackage1.moduleX
|
||||
Reference in New Issue
Block a user