Skip to content

Commit

Permalink
Merge pull request #571 from Carreau/py3-comp
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Jun 17, 2020
2 parents fecaf0e + c35c97b commit 2dfb8c5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions traitlets/utils/descriptions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import inspect
import re
import six
import types
import inspect


def describe(article, value, name=None, verbose=False, capital=False):
Expand Down Expand Up @@ -73,7 +72,7 @@ class name where an object was defined.

if article == "the" or (article is None and not inspect.isclass(value)):
if name is not None:
result = "%s %s" % (typename, name)
result = "{} {}".format(typename, name)
if article is not None:
return add_article(result, True, capital)
else:
Expand Down Expand Up @@ -167,8 +166,5 @@ def repr_type(obj):
error messages.
"""
the_type = type(obj)
if six.PY2 and the_type is types.InstanceType:
# Old-style class.
the_type = obj.__class__
msg = '%r %r' % (obj, the_type)
msg = '{!r} {!r}'.format(obj, the_type)
return msg

0 comments on commit 2dfb8c5

Please sign in to comment.