Skip to content

Commit 71b7076

Browse files
authored
Merge pull request #10558 from cclauss/remove-six.PY2-from-boilerplate.py
Remove if six.PY2 code paths from boilerplate.py
2 parents d7feb4a + e449b84 commit 71b7076

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

tools/boilerplate.py

+4-21
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
# For some later history, see
1818
# http://thread.gmane.org/gmane.comp.python.matplotlib.devel/7068
1919

20-
from __future__ import (absolute_import, division, print_function,
21-
unicode_literals)
22-
23-
import six
24-
2520
import os
2621
import inspect
2722
import random
@@ -154,7 +149,7 @@ def boilerplate_gen():
154149
'semilogx',
155150
'semilogy',
156151
'specgram',
157-
#'spy',
152+
# 'spy',
158153
'stackplot',
159154
'stem',
160155
'step',
@@ -233,22 +228,10 @@ def format_value(value):
233228
has_data = 'data' in inspect.signature(base_func).parameters
234229
work_func = inspect.unwrap(base_func)
235230

236-
if six.PY2:
237-
args, varargs, varkw, defaults = inspect.getargspec(work_func)
238-
else:
239-
(args, varargs, varkw, defaults, kwonlyargs, kwonlydefs,
240-
annotations) = inspect.getfullargspec(work_func)
231+
(args, varargs, varkw, defaults, kwonlyargs, kwonlydefs,
232+
annotations) = inspect.getfullargspec(work_func)
241233
args.pop(0) # remove 'self' argument
242-
if defaults is None:
243-
defaults = ()
244-
else:
245-
def_edited = []
246-
for val in defaults:
247-
if six.PY2:
248-
if isinstance(val, unicode):
249-
val = val.encode('ascii', 'ignore')
250-
def_edited.append(val)
251-
defaults = tuple(def_edited)
234+
defaults = tuple(defaults or ())
252235

253236
# Add a data keyword argument if needed (fmt is PLOT_TEMPLATE) and
254237
# possible (if *args is used, we can't just add a data

0 commit comments

Comments
 (0)