Commit b7354452 authored by Jason R. Coombs's avatar Jason R. Coombs

Merge branch 'issue-889'

parents f1f9200d 07a7b06d
......@@ -7,6 +7,7 @@ import distutils.filelist
import platform
import types
import functools
import inspect
from .py26compat import import_module
from setuptools.extern import six
......@@ -35,12 +36,16 @@ def get_unpatched_class(cls):
Also ensures that no other distutils extension monkeypatched the distutils
first.
"""
while cls.__module__.startswith('setuptools'):
cls, = cls.__bases__
if not cls.__module__.startswith('distutils'):
external_bases = (
cls
for cls in inspect.getmro(cls)
if not cls.__module__.startswith('setuptools')
)
base = next(external_bases)
if not base.__module__.startswith('distutils'):
msg = "distutils has already been patched by %r" % cls
raise AssertionError(msg)
return cls
return base
def patch_all():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment