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
498fec28
Commit
498fec28
authored
Apr 27, 2017
by
Jason R. Coombs
Committed by
GitHub
Apr 27, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1025 from LordGaav/fix-mro-on-jython. Fixes #1024.
Use a different method to lookup base classes on Jython
parents
d8e1ed57
81c15b50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
CHANGES.rst
CHANGES.rst
+5
-0
setuptools/monkey.py
setuptools/monkey.py
+15
-1
No files found.
CHANGES.rst
View file @
498fec28
v35
.0.2
-------
*
#
1024
:
Add
workaround
for
Jython
#
2581
in
monkey
module
.
v35
.0.1
-------
...
...
setuptools/monkey.py
View file @
498fec28
...
...
@@ -21,6 +21,20 @@ if you think you need this functionality.
"""
def
_get_mro
(
cls
):
"""
Returns the bases classes for cls sorted by the MRO.
Works around an issue on Jython where inspect.getmro will not return all
base classes if multiple classes share the same name. Instead, this
function will return a tuple containing the class itself, and the contents
of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024.
"""
if
platform
.
python_implementation
()
==
"Jython"
:
return
(
cls
,)
+
cls
.
__bases__
return
inspect
.
getmro
(
cls
)
def
get_unpatched
(
item
):
lookup
=
(
get_unpatched_class
if
isinstance
(
item
,
six
.
class_types
)
else
...
...
@@ -38,7 +52,7 @@ def get_unpatched_class(cls):
"""
external_bases
=
(
cls
for
cls
in
inspect
.
get
mro
(
cls
)
for
cls
in
_get_
mro
(
cls
)
if
not
cls
.
__module__
.
startswith
(
'setuptools'
)
)
base
=
next
(
external_bases
)
...
...
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