Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
e2bc5bcf
Commit
e2bc5bcf
authored
Jun 13, 2013
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18200: Update the stdlib (except tests) to use
ModuleNotFoundError.
parent
38c067b7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
13 deletions
+11
-13
archive_util.py
archive_util.py
+1
-1
ccompiler.py
ccompiler.py
+3
-4
dist.py
dist.py
+4
-5
msvccompiler.py
msvccompiler.py
+2
-2
util.py
util.py
+1
-1
No files found.
archive_util.py
View file @
e2bc5bcf
...
...
@@ -9,7 +9,7 @@ import sys
try
:
import
zipfile
except
Import
Error
:
except
ModuleNotFound
Error
:
zipfile
=
None
...
...
ccompiler.py
View file @
e2bc5bcf
...
...
@@ -3,7 +3,7 @@
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
import
sys
,
os
,
re
import
importlib
,
sys
,
os
,
re
from
distutils.errors
import
*
from
distutils.spawn
import
spawn
from
distutils.file_util
import
move_file
...
...
@@ -1013,10 +1013,9 @@ def new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0):
try
:
module_name
=
"distutils."
+
module_name
__import__
(
module_name
)
module
=
sys
.
modules
[
module_name
]
module
=
importlib
.
import_module
(
module_name
)
klass
=
vars
(
module
)[
class_name
]
except
Import
Error
:
except
ModuleNotFound
Error
:
raise
DistutilsModuleError
(
"can't compile C/C++ code: unable to load module '%s'"
%
\
module_name
)
...
...
dist.py
View file @
e2bc5bcf
...
...
@@ -4,11 +4,11 @@ Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
"""
import
sys
,
os
,
re
import
importlib
,
sys
,
os
,
re
try
:
import
warnings
except
Import
Error
:
except
ModuleNotFound
Error
:
warnings
=
None
from
distutils.errors
import
*
...
...
@@ -788,9 +788,8 @@ Common commands: (see '--help-commands' for more)
klass_name
=
command
try
:
__import__
(
module_name
)
module
=
sys
.
modules
[
module_name
]
except
ImportError
:
module
=
importlib
.
import_module
(
module_name
)
except
ModuleNotFoundError
:
continue
try
:
...
...
msvccompiler.py
View file @
e2bc5bcf
...
...
@@ -28,7 +28,7 @@ try:
RegEnumValue
=
winreg
.
EnumValue
RegError
=
winreg
.
error
except
Import
Error
:
except
ModuleNotFound
Error
:
try
:
import
win32api
import
win32con
...
...
@@ -39,7 +39,7 @@ except ImportError:
RegEnumKey
=
win32api
.
RegEnumKey
RegEnumValue
=
win32api
.
RegEnumValue
RegError
=
win32api
.
error
except
Import
Error
:
except
ModuleNotFound
Error
:
log
.
info
(
"Warning: Can't read registry to find the "
"necessary compiler setting
\
n
"
"Make sure that Python modules winreg, "
...
...
util.py
View file @
e2bc5bcf
...
...
@@ -388,7 +388,7 @@ def byte_compile (py_files,
try:
from tempfile import mkstemp
(script_fd, script_name) = mkstemp(".py")
except
Import
Error:
except
ModuleNotFound
Error:
from tempfile import mktemp
(script_fd, script_name) = None, mktemp(".py")
log.info("writing byte-compilation script '%s'", script_name)
...
...
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