##// END OF EJS Templates
Remove try/except handing Python2 (#14204)
Matthias Bussonnier -
r28460:5d64897b merge
parent child Browse files
Show More
@@ -841,17 +841,8 b' _env_type = type(os.environ)'
841 841 if _env_type is not dict:
842 842 _type_pprinters[_env_type] = _dict_pprinter_factory('environ{', '}')
843 843
844 try:
845 # In PyPy, types.DictProxyType is dict, setting the dictproxy printer
846 # using dict.setdefault avoids overwriting the dict printer
847 _type_pprinters.setdefault(types.DictProxyType,
848 _dict_pprinter_factory('dict_proxy({', '})'))
849 _type_pprinters[types.ClassType] = _type_pprint
850 _type_pprinters[types.SliceType] = _repr_pprint
851 except AttributeError: # Python 3
852 _type_pprinters[types.MappingProxyType] = \
853 _dict_pprinter_factory('mappingproxy({', '})')
854 _type_pprinters[slice] = _repr_pprint
844 _type_pprinters[types.MappingProxyType] = _dict_pprinter_factory("mappingproxy({", "})")
845 _type_pprinters[slice] = _repr_pprint
855 846
856 847 _type_pprinters[range] = _repr_pprint
857 848 _type_pprinters[bytes] = _repr_pprint
General Comments 0
You need to be logged in to leave comments. Login now