Merge pull request #282 from cjmayo/python3_31

{python3_31} Python3: fix strformat strline()
This commit is contained in:
anarcat 2019-09-13 09:11:33 -04:00 committed by GitHub
commit b0b392f7cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -322,7 +322,11 @@ def limit (s, length=72):
def strline (s):
"""Display string representation on one line."""
return strip_control_chars(u"`%s'" % unicode(s).replace(u"\n", u"\\n"))
try:
s = unicode(s)
except NameError:
pass
return strip_control_chars(u"`%s'" % s.replace(u"\n", u"\\n"))
def format_feature_warning (**kwargs):