FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/python/extractor/python_tracer.py at main · github/codeql · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
github
/
codeql
Public
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
10k
Code
Issues
997
Pull requests
454
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
python
/
extractor
/
python_tracer.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
53 lines (46 loc) · 1.64 KB
Breadcrumbs
codeql
/
python
/
extractor
/
python_tracer.py
Copy path
File metadata and controls
executable file
·
53 lines (46 loc) · 1.64 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python
#This file needs to be able to handle all versions of Python we are likely to encounter
#Which is probably 2.6 and upwards
'''This module sets up sys.path from the environment
and runs the populator when called from semmle tools such as buildSnapshot.'''
import
sys
import
os
# The constant is put here instead of make_zips.py, since make_zips.py is not present in
# the distributed extractor-python code
def
getzipfilename
():
return
'python3src.zip'
def
load_library
():
try
:
tools
=
os
.
environ
[
'ODASA_TOOLS'
]
except
KeyError
:
try
:
tools
=
os
.
path
.
join
(
os
.
environ
[
'SEMMLE_DIST'
],
"tools"
)
except
KeyError
:
tools
=
sys
.
path
[
0
]
try
:
zippath
=
os
.
path
.
join
(
tools
,
getzipfilename
())
sys
.
path
=
[
zippath
]
+
sys
.
path
except
Exception
:
#Failed to find tools. Error is reported below
zippath
=
tools
try
:
import
semmle
.
populator
except
ImportError
as
ex
:
print
(
"FATAL ERROR: "
)
print
(
ex
)
if
tools
is
not
None
:
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
tools
,
getzipfilename
())):
sys
.
stderr
.
write
(
"No tracer library found in "
+
tools
+
"
\n
"
)
else
:
sys
.
stderr
.
write
(
"Unable to load tracer library at %s:
\n
"
%
zippath
)
import
traceback
traceback
.
print_exc
(
file
=
sys
.
stderr
)
else
:
print
(
sys
.
path
)
sys
.
stderr
.
write
(
"Cannot find Semmle tools
\n
"
)
sys
.
exit
(
2
)
if
__name__
==
"__main__"
:
original_path
=
sys
.
path
load_library
()
import
semmle
.
populator
semmle
.
populator
.
main
(
original_path
)
Back
|
FazBrowse Home
|
New Git URL