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
fbc78518
Commit
fbc78518
authored
Jan 02, 2014
by
Eric Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20097: Fix bad use of "self" in importlib's WindowsRegistryFinder.
parent
9dee3042
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1892 additions
and
1861 deletions
+1892
-1861
Lib/importlib/_bootstrap.py
Lib/importlib/_bootstrap.py
+1
-1
Lib/test/test_importlib/test_windows.py
Lib/test/test_importlib/test_windows.py
+29
-0
Misc/NEWS
Misc/NEWS
+2
-0
Python/importlib.h
Python/importlib.h
+1860
-1860
No files found.
Lib/importlib/_bootstrap.py
View file @
fbc78518
...
...
@@ -1406,7 +1406,7 @@ class WindowsRegistryFinder:
@
classmethod
def
find_module
(
cls
,
fullname
,
path
=
None
):
"""Find module named in the registry."""
spec
=
self
.
find_spec
(
fullname
,
path
)
spec
=
cls
.
find_spec
(
fullname
,
path
)
if
spec
is
not
None
:
return
spec
.
loader
else
:
...
...
Lib/test/test_importlib/test_windows.py
0 → 100644
View file @
fbc78518
from
.
import
util
frozen_machinery
,
source_machinery
=
util
.
import_importlib
(
'importlib.machinery'
)
import
sys
import
unittest
@
unittest
.
skipUnless
(
sys
.
platform
.
startswith
(
'win'
),
'requires Windows'
)
class
WindowsRegistryFinderTests
:
# XXX Need a test that finds the spec via the registry.
def
test_find_spec_missing
(
self
):
spec
=
self
.
machinery
.
WindowsRegistryFinder
.
find_spec
(
'spam'
)
self
.
assertIs
(
spec
,
None
)
def
test_find_module_missing
(
self
):
loader
=
self
.
machinery
.
WindowsRegistryFinder
.
find_module
(
'spam'
)
self
.
assertIs
(
loader
,
None
)
class
Frozen_WindowsRegistryFinderTests
(
WindowsRegistryFinderTests
,
unittest
.
TestCase
):
machinery
=
frozen_machinery
class
Source_WindowsRegistryFinderTests
(
WindowsRegistryFinderTests
,
unittest
.
TestCase
):
machinery
=
source_machinery
Misc/NEWS
View file @
fbc78518
...
...
@@ -36,6 +36,8 @@ Core and Builtins
- Issue #19736: Add module-level statvfs constants defined for GNU/glibc
based systems.
- Issue #20097: Fix bad use of "self" in importlib'
s
WindowsRegistryFinder
.
-
Issue
#
19729
:
In
str
.
format
(),
fix
recursive
expansion
in
format
spec
.
-
Issue
#
19638
:
Fix
possible
crash
/
undefined
behaviour
from
huge
(
more
than
2
...
...
Python/importlib.h
View file @
fbc78518
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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