aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/ipython/py3/IPython/lib/pretty.py
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2023-11-14 19:18:07 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2023-11-14 20:20:53 +0300
commit874ef51d3d3edfa25f5a505ec6ab50e172965d1e (patch)
tree620fb5e02063d23509d3aa3df2215c099ccde0b7 /contrib/python/ipython/py3/IPython/lib/pretty.py
parente356b34d3b0399e2f170881af15c91e4db9e3d11 (diff)
downloadydb-874ef51d3d3edfa25f5a505ec6ab50e172965d1e.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python/ipython/py3/IPython/lib/pretty.py')
-rw-r--r--contrib/python/ipython/py3/IPython/lib/pretty.py13
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 3486450786..2575c3b0a9 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