Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7682bb1

Browse files
committed
Merge pull request #5014 from jenshnielsen/python36nightly
FIX/TST: Add 3.6 compatibility testing
2 parents 38fee26 + 22f532e commit 7682bb1

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ matrix:
4646
env: BUILD_DOCS=true MOCK=mock
4747
- python: "3.5.0rc4"
4848
env: PRE=--pre
49+
- python: "nightly"
50+
env: PRE=--pre
51+
allow_failures:
52+
- python: "nightly"
4953

5054
before_install:
5155
- source tools/travis_tools.sh

boilerplate.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,11 @@ def format_value(value):
214214
has_data = 'data' in inspect.signature(base_func).parameters
215215
work_func = inspect.unwrap(base_func)
216216

217-
args, varargs, varkw, defaults = inspect.getargspec(work_func)
218-
217+
if six.PY2:
218+
args, varargs, varkw, defaults = inspect.getargspec(work_func)
219+
else:
220+
(args, varargs, varkw, defaults, kwonlyargs, kwonlydefs,
221+
annotations) = inspect.getfullargspec(work_func)
219222
args.pop(0) # remove 'self' argument
220223
if defaults is None:
221224
defaults = ()

lib/matplotlib/artist.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,11 @@ def _get_setters_and_targets(self):
11101110
o = getattr(self.o, name)
11111111
if not six.callable(o):
11121112
continue
1113-
if len(inspect.getargspec(o)[0]) < 2:
1113+
if six.PY2:
1114+
nargs = len(inspect.getargspec(o)[0])
1115+
else:
1116+
nargs = len(inspect.getfullargspec(o)[0])
1117+
if nargs < 2:
11141118
continue
11151119
func = o
11161120
if self.is_alias(func):

lib/matplotlib/patches.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,11 @@ def _pprint_styles(_styles):
17811781
_table = [["Class", "Name", "Attrs"]]
17821782

17831783
for name, cls in sorted(_styles.items()):
1784-
args, varargs, varkw, defaults = inspect.getargspec(cls.__init__)
1784+
if six.PY2:
1785+
args, varargs, varkw, defaults = inspect.getargspec(cls.__init__)
1786+
else:
1787+
(args, varargs, varkw, defaults, kwonlyargs, kwonlydefs,
1788+
annotations) = inspect.getfullargspec(cls.__init__)
17851789
if defaults:
17861790
args = [(argname, argdefault)
17871791
for argname, argdefault in zip(args[1:], defaults)]

0 commit comments

Comments
 (0)