--- pprint.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) Index: PATCH/pprint.py =================================================================== --- PATCH.orig/pprint.py +++ PATCH/pprint.py @@ -295,23 +295,7 @@ class PrettyPrinter: def _safe_repr(object, context, maxlevels, level): typ = _type(object) if typ is str: - if 'locale' not in _sys.modules: - return repr(object), True, False - if "'" in object and '"' not in object: - closure = '"' - quotes = {'"': '\\"'} - else: - closure = "'" - quotes = {"'": "\\'"} - qget = quotes.get - sio = _StringIO() - write = sio.write - for char in object: - if char.isalpha(): - write(char) - else: - write(qget(char, repr(char)[1:-1])) - return ("%s%s%s" % (closure, sio.getvalue(), closure)), True, False + return repr(object), True, False r = getattr(typ, "__repr__", None) if issubclass(typ, dict) and r is dict.__repr__: