##// END OF EJS Templates
Remove try/except handing Python2
Matthias Bussonnier -
Show More
@@ -841,17 +841,8 b' _env_type = type(os.environ)'
841 if _env_type is not dict:
841 if _env_type is not dict:
842 _type_pprinters[_env_type] = _dict_pprinter_factory('environ{', '}')
842 _type_pprinters[_env_type] = _dict_pprinter_factory('environ{', '}')
843
843
844 try:
844 _type_pprinters[types.MappingProxyType] = _dict_pprinter_factory("mappingproxy({", "})")
845 # In PyPy, types.DictProxyType is dict, setting the dictproxy printer
845 _type_pprinters[slice] = _repr_pprint
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
855
846
856 _type_pprinters[range] = _repr_pprint
847 _type_pprinters[range] = _repr_pprint
857 _type_pprinters[bytes] = _repr_pprint
848 _type_pprinters[bytes] = _repr_pprint
General Comments 0
You need to be logged in to leave comments. Login now