diff options
| author | robot-piglet <[email protected]> | 2023-11-14 19:18:07 +0300 | 
|---|---|---|
| committer | robot-piglet <[email protected]> | 2023-11-14 20:20:53 +0300 | 
| commit | 874ef51d3d3edfa25f5a505ec6ab50e172965d1e (patch) | |
| tree | 620fb5e02063d23509d3aa3df2215c099ccde0b7 /contrib/python/ipython/py3/IPython/lib | |
| parent | e356b34d3b0399e2f170881af15c91e4db9e3d11 (diff) | |
Intermediate changes
Diffstat (limited to 'contrib/python/ipython/py3/IPython/lib')
| -rw-r--r-- | contrib/python/ipython/py3/IPython/lib/pretty.py | 13 | 
1 files changed, 2 insertions, 11 deletions
| diff --git a/contrib/python/ipython/py3/IPython/lib/pretty.py b/contrib/python/ipython/py3/IPython/lib/pretty.py index 34864507866..2575c3b0a94 100644 --- a/contrib/python/ipython/py3/IPython/lib/pretty.py +++ b/contrib/python/ipython/py3/IPython/lib/pretty.py @@ -841,17 +841,8 @@ _env_type = type(os.environ)  if _env_type is not dict:      _type_pprinters[_env_type] = _dict_pprinter_factory('environ{', '}') -try: -    # In PyPy, types.DictProxyType is dict, setting the dictproxy printer -    # using dict.setdefault avoids overwriting the dict printer -    _type_pprinters.setdefault(types.DictProxyType, -                               _dict_pprinter_factory('dict_proxy({', '})')) -    _type_pprinters[types.ClassType] = _type_pprint -    _type_pprinters[types.SliceType] = _repr_pprint -except AttributeError: # Python 3 -    _type_pprinters[types.MappingProxyType] = \ -        _dict_pprinter_factory('mappingproxy({', '})') -    _type_pprinters[slice] = _repr_pprint +_type_pprinters[types.MappingProxyType] = _dict_pprinter_factory("mappingproxy({", "})") +_type_pprinters[slice] = _repr_pprint  _type_pprinters[range] = _repr_pprint  _type_pprinters[bytes] = _repr_pprint | 
