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
ddb91c20
Commit
ddb91c20
authored
Dec 31, 2015
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the technique even more generic
--HG-- branch : feature/issue-229
parent
952c1baf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
setuptools/extern/six.py
setuptools/extern/six.py
+6
-7
No files found.
setuptools/extern/six.py
View file @
ddb91c20
"""
"""
Handle loading
six
package from system or from the bundled copy
Handle loading
a
package from system or from the bundled copy
"""
"""
import
imp
import
imp
_S
IX_S
EARCH_PATH
=
[
'setuptools._vendor.six'
,
'six'
]
_SEARCH_PATH
=
[
'setuptools._vendor.six'
,
'six'
]
def
_find_module
(
name
,
path
=
None
):
def
_find_module
(
name
,
path
=
None
):
...
@@ -24,7 +24,7 @@ def _find_module(name, path=None):
...
@@ -24,7 +24,7 @@ def _find_module(name, path=None):
return
fh
,
path
,
descr
return
fh
,
path
,
descr
def
_import_
six
(
search_path
=
_SIX
_SEARCH_PATH
):
def
_import_
in_place
(
search_path
=
_SEARCH_PATH
):
for
mod_name
in
search_path
:
for
mod_name
in
search_path
:
try
:
try
:
mod_info
=
_find_module
(
mod_name
)
mod_info
=
_find_module
(
mod_name
)
...
@@ -32,15 +32,14 @@ def _import_six(search_path=_SIX_SEARCH_PATH):
...
@@ -32,15 +32,14 @@ def _import_six(search_path=_SIX_SEARCH_PATH):
continue
continue
imp
.
load_module
(
__name__
,
*
mod_info
)
imp
.
load_module
(
__name__
,
*
mod_info
)
break
break
else
:
else
:
raise
ImportError
(
raise
ImportError
(
"The '
six' module of minimum version {0}
is required; "
"The '
{name}' package
is required; "
"normally this is bundled with this package so if you get "
"normally this is bundled with this package so if you get "
"this warning, consult the packager of your "
"this warning, consult the packager of your "
"distribution."
)
"distribution."
.
format
(
name
=
_SEARCH_PATH
[
-
1
])
)
_import_
six
()
_import_
in_place
()
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