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
260fbe80
Commit
260fbe80
authored
Jul 04, 2013
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #15767: Excise the remaining instances of ModuleNotFoundError
parent
3dfd2324
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
27 deletions
+27
-27
Lib/stat.py
Lib/stat.py
+1
-1
Lib/test/regrtest.py
Lib/test/regrtest.py
+8
-8
Lib/test/support.py
Lib/test/support.py
+8
-8
Lib/test/test___all__.py
Lib/test/test___all__.py
+1
-1
Lib/test/test_tarfile.py
Lib/test/test_tarfile.py
+3
-3
Lib/test/test_xmlrpc.py
Lib/test/test_xmlrpc.py
+2
-2
Lib/xmlrpc/server.py
Lib/xmlrpc/server.py
+1
-1
Lib/zipfile.py
Lib/zipfile.py
+3
-3
No files found.
Lib/stat.py
View file @
260fbe80
...
...
@@ -151,5 +151,5 @@ def filemode(mode):
# If available, use C implementation
try
:
from
_stat
import
*
except
ModuleNotFound
Error
:
except
Import
Error
:
pass
Lib/test/regrtest.py
View file @
260fbe80
...
...
@@ -146,11 +146,11 @@ from inspect import isabstract
try
:
import
threading
except
ModuleNotFound
Error
:
except
Import
Error
:
threading
=
None
try
:
import
multiprocessing.process
except
ModuleNotFound
Error
:
except
Import
Error
:
multiprocessing
=
None
...
...
@@ -180,7 +180,7 @@ for module in sys.modules.values():
if
sys
.
platform
==
'darwin'
:
try
:
import
resource
except
ModuleNotFound
Error
:
except
Import
Error
:
pass
else
:
soft
,
hard
=
resource
.
getrlimit
(
resource
.
RLIMIT_STACK
)
...
...
@@ -567,7 +567,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
if
findleaks
:
try
:
import
gc
except
ModuleNotFound
Error
:
except
Import
Error
:
print
(
'No GC available, disabling findleaks.'
)
findleaks
=
False
else
:
...
...
@@ -688,7 +688,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
if
use_mp
:
try
:
from
threading
import
Thread
except
ModuleNotFound
Error
:
except
Import
Error
:
print
(
"Multiprocess option requires thread support"
)
sys
.
exit
(
2
)
from
queue
import
Queue
...
...
@@ -1399,7 +1399,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
pic = sys.path_importer_cache.copy()
try:
import zipimport
except
ModuleNotFound
Error:
except
Import
Error:
zdc = None # Run unmodified on platforms without zipimport support
else:
zdc = zipimport._zip_directory_cache.copy()
...
...
@@ -1476,7 +1476,7 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
sys.path_importer_cache.update(pic)
try:
import zipimport
except
ModuleNotFound
Error:
except
Import
Error:
pass # Run unmodified on platforms without zipimport support
else:
zipimport._zip_directory_cache.clear()
...
...
@@ -1513,7 +1513,7 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
doctest.master = None
try:
import ctypes
except
ModuleNotFound
Error:
except
Import
Error:
# Don't worry about resetting the cache if ctypes is not supported
pass
else:
...
...
Lib/test/support.py
View file @
260fbe80
...
...
@@ -29,32 +29,32 @@ import _testcapi
try
:
import
_thread
,
threading
except
ModuleNotFound
Error
:
except
Import
Error
:
_thread
=
None
threading
=
None
try
:
import
multiprocessing.process
except
ModuleNotFound
Error
:
except
Import
Error
:
multiprocessing
=
None
try
:
import
zlib
except
ModuleNotFound
Error
:
except
Import
Error
:
zlib
=
None
try
:
import
gzip
except
ModuleNotFound
Error
:
except
Import
Error
:
gzip
=
None
try
:
import
bz2
except
ModuleNotFound
Error
:
except
Import
Error
:
bz2
=
None
try
:
import
lzma
except
ModuleNotFound
Error
:
except
Import
Error
:
lzma
=
None
__all__
=
[
...
...
@@ -121,7 +121,7 @@ def import_module(name, deprecated=False, *, required_on=()):
with
_ignore_deprecated_imports
(
deprecated
):
try
:
return
importlib
.
import_module
(
name
)
except
ModuleNotFound
Error
as
msg
:
except
Import
Error
as
msg
:
if
sys
.
platform
.
startswith
(
tuple
(
required_on
)):
raise
raise
unittest
.
SkipTest
(
str
(
msg
))
...
...
@@ -193,7 +193,7 @@ def import_fresh_module(name, fresh=(), blocked=(), deprecated=False):
if
not
_save_and_block_module
(
blocked_name
,
orig_modules
):
names_to_remove
.
append
(
blocked_name
)
fresh_module
=
importlib
.
import_module
(
name
)
except
ModuleNotFound
Error
:
except
Import
Error
:
fresh_module
=
None
finally
:
for
orig_name
,
module
in
orig_modules
.
items
():
...
...
Lib/test/test___all__.py
View file @
260fbe80
...
...
@@ -75,7 +75,7 @@ class AllTest(unittest.TestCase):
try
:
import
rlcompleter
import
locale
except
ModuleNotFound
Error
:
except
Import
Error
:
pass
else
:
locale
.
setlocale
(
locale
.
LC_CTYPE
,
'C'
)
...
...
Lib/test/test_tarfile.py
View file @
260fbe80
...
...
@@ -12,15 +12,15 @@ from test import support
# Check for our compression modules.
try
:
import
gzip
except
ModuleNotFound
Error
:
except
Import
Error
:
gzip
=
None
try
:
import
bz2
except
ModuleNotFound
Error
:
except
Import
Error
:
bz2
=
None
try
:
import
lzma
except
ModuleNotFound
Error
:
except
Import
Error
:
lzma
=
None
def
md5sum
(
data
):
...
...
Lib/test/test_xmlrpc.py
View file @
260fbe80
...
...
@@ -15,11 +15,11 @@ from test import support
try
:
import
gzip
except
ModuleNotFound
Error
:
except
Import
Error
:
gzip
=
None
try
:
import
threading
except
ModuleNotFound
Error
:
except
Import
Error
:
threading
=
None
alist
=
[{
'astring'
:
'foo@bar.baz.spam'
,
...
...
Lib/xmlrpc/server.py
View file @
260fbe80
...
...
@@ -116,7 +116,7 @@ import inspect
import
traceback
try
:
import
fcntl
except
ModuleNotFound
Error
:
except
Import
Error
:
fcntl
=
None
def
resolve_dotted_attribute
(
obj
,
attr
,
allow_dotted_names
=
True
):
...
...
Lib/zipfile.py
View file @
260fbe80
...
...
@@ -18,18 +18,18 @@ import binascii
try
:
import
zlib
# We may need its compression method
crc32
=
zlib
.
crc32
except
ModuleNotFound
Error
:
except
Import
Error
:
zlib
=
None
crc32
=
binascii
.
crc32
try
:
import
bz2
# We may need its compression method
except
ModuleNotFound
Error
:
except
Import
Error
:
bz2
=
None
try
:
import
lzma
# We may need its compression method
except
ModuleNotFound
Error
:
except
Import
Error
:
lzma
=
None
__all__
=
[
"BadZipFile"
,
"BadZipfile"
,
"error"
,
...
...
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