mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
parent
ecfeb7f095
commit
70a6b49821
246 changed files with 926 additions and 962 deletions
|
@ -212,7 +212,7 @@ def _safe_repr(object, context, maxlevels, level):
|
|||
typ = _type(object)
|
||||
if typ is str:
|
||||
if 'locale' not in _sys.modules:
|
||||
return `object`, True, False
|
||||
return repr(object), True, False
|
||||
if "'" in object and '"' not in object:
|
||||
closure = '"'
|
||||
quotes = {'"': '\\"'}
|
||||
|
@ -226,7 +226,7 @@ def _safe_repr(object, context, maxlevels, level):
|
|||
if char.isalpha():
|
||||
write(char)
|
||||
else:
|
||||
write(qget(char, `char`[1:-1]))
|
||||
write(qget(char, repr(char)[1:-1]))
|
||||
return ("%s%s%s" % (closure, sio.getvalue(), closure)), True, False
|
||||
|
||||
r = typ.__repr__
|
||||
|
@ -288,7 +288,7 @@ def _safe_repr(object, context, maxlevels, level):
|
|||
del context[objid]
|
||||
return format % _commajoin(components), readable, recursive
|
||||
|
||||
rep = `object`
|
||||
rep = repr(object)
|
||||
return rep, (rep and not rep.startswith('<')), False
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue