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
9bd059ff
Commit
9bd059ff
authored
Aug 04, 2008
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence warnings under -3 about using dict.has_key() for modulefinder.
parent
5dd504df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Lib/modulefinder.py
Lib/modulefinder.py
+4
-3
No files found.
Lib/modulefinder.py
View file @
9bd059ff
...
...
@@ -258,7 +258,7 @@ class ModuleFinder:
else
:
self
.
msgout
(
3
,
"import_module ->"
,
m
)
return
m
if
self
.
badmodules
.
has_key
(
fqname
)
:
if
fqname
in
self
.
badmodules
:
self
.
msgout
(
3
,
"import_module -> None"
)
return
None
if
parent
and
parent
.
__path__
is
None
:
...
...
@@ -279,7 +279,8 @@ class ModuleFinder:
self
.
msgout
(
3
,
"import_module ->"
,
m
)
return
m
def
load_module
(
self
,
fqname
,
fp
,
pathname
,
(
suffix
,
mode
,
type
)):
def
load_module
(
self
,
fqname
,
fp
,
pathname
,
file_info
):
suffix
,
mode
,
type
=
file_info
self
.
msgin
(
2
,
"load_module"
,
fqname
,
fp
and
"fp"
,
pathname
)
if
type
==
imp
.
PKG_DIRECTORY
:
m
=
self
.
load_package
(
fqname
,
pathname
)
...
...
@@ -460,7 +461,7 @@ class ModuleFinder:
return
m
def
add_module
(
self
,
fqname
):
if
self
.
modules
.
has_key
(
fqname
)
:
if
fqname
in
self
.
modules
:
return
self
.
modules
[
fqname
]
self
.
modules
[
fqname
]
=
m
=
Module
(
fqname
)
return
m
...
...
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