Work around utter disregard of semver

This commit is contained in:
Markus Unterwaditzer 2015-09-22 15:49:21 +02:00
parent 611ceac847
commit 7a945e3721
2 changed files with 5 additions and 3 deletions

View file

@ -4,7 +4,7 @@ import os
import sys
import uuid
from .compat import iteritems, to_unicode
from .compat import getargspec_ish, iteritems, to_unicode
from .. import exceptions
@ -84,8 +84,7 @@ def get_etag_from_fileobject(f):
def get_class_init_specs(cls, stop_at=object):
if cls is stop_at:
return ()
import inspect
spec = inspect.getargspec(cls.__init__)
spec = getargspec_ish(cls.__init__)
supercls = next(getattr(x.__init__, '__objclass__', x)
for x in cls.__mro__[1:])
return (spec,) + get_class_init_specs(supercls, stop_at=stop_at)

View file

@ -34,6 +34,7 @@ def _wrap_native(f, encoding='utf-8'):
if PY2: # pragma: no cover
import urlparse
import urllib as _urllib
from inspect import getargspec as getargspec_ish # noqa
# Horrible hack to make urllib play nice with u'...' urls from requests
urlquote = _wrap_native(_urllib.quote)
@ -46,6 +47,8 @@ if PY2: # pragma: no cover
else: # pragma: no cover
import urllib.parse as urlparse
from inspect import getfullargspec as getargspec_ish # noqa
urlquote = urlparse.quote
urlunquote = urlparse.unquote
text_type = str