Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d3d7bb1c
Commit
d3d7bb1c
authored
Nov 06, 2000
by
Mark Hammond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Application of [ Patch #102226 ] freeze/modulefinder.py should use _winreg, not win32api
parent
fad27aee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
15 deletions
+6
-15
Tools/freeze/modulefinder.py
Tools/freeze/modulefinder.py
+6
-15
No files found.
Tools/freeze/modulefinder.py
View file @
d3d7bb1c
...
...
@@ -8,17 +8,6 @@ import re
import
string
import
sys
if
sys
.
platform
==
"win32"
:
# On Windows, we can locate modules in the registry with
# the help of the win32api package.
try
:
import
win32api
except
ImportError
:
print
"The win32api module is not available - modules listed"
print
"in the registry will not be found."
win32api
=
None
IMPORT_NAME
=
dis
.
opname
.
index
(
'IMPORT_NAME'
)
IMPORT_FROM
=
dis
.
opname
.
index
(
'IMPORT_FROM'
)
STORE_NAME
=
dis
.
opname
.
index
(
'STORE_NAME'
)
...
...
@@ -339,15 +328,17 @@ class ModuleFinder:
return
(
None
,
None
,
(
""
,
""
,
imp
.
C_BUILTIN
))
# Emulate the Registered Module support on Windows.
if
sys
.
platform
==
"win32"
and
win32api
is
not
None
:
HKEY_LOCAL_MACHINE
=
0x80000002
if
sys
.
platform
==
"win32"
:
import
_winreg
from
_winreg
import
HKEY_LOCAL_MACHINE
try
:
pathname
=
win32api
.
RegQueryValue
(
HKEY_LOCAL_MACHINE
,
"Software
\
\
Python
\
\
PythonCore
\
\
%s
\
\
Modules
\
\
%s"
%
(
sys
.
winver
,
name
))
pathname
=
_winreg
.
QueryValueEx
(
HKEY_LOCAL_MACHINE
,
\
"Software
\
\
Python
\
\
PythonCore
\
\
%s
\
\
Modules
\
\
%s"
%
(
sys
.
winver
,
name
))
fp
=
open
(
pathname
,
"rb"
)
# XXX - To do - remove the hard code of C_EXTENSION.
stuff
=
""
,
"rb"
,
imp
.
C_EXTENSION
return
fp
,
pathname
,
stuff
except
win32api
.
error
:
except
_winreg
.
error
:
pass
path
=
self
.
path
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment