Fix naked except clauses; update CHANGELOG

This commit is contained in:
Griatch 2022-08-02 13:53:08 +02:00
parent bb8781efad
commit 7a06db9ffb
2 changed files with 5 additions and 4 deletions

View file

@ -176,6 +176,7 @@ Up requirements to Django 4.0+, Twisted 22+, Python 3.9 or 3.10
even though doc suggested one could (ChrisLR) even though doc suggested one could (ChrisLR)
- New contrib `name_generator` for building random real-world based or fantasy-names - New contrib `name_generator` for building random real-world based or fantasy-names
based on phonetic rules. based on phonetic rules.
- Enable proper serialization of dict subclasses in Attributes (aogier)
## Evennia 0.9.5 ## Evennia 0.9.5

View file

@ -653,7 +653,7 @@ def to_pickle(data):
) )
except (AttributeError, TypeError): except (AttributeError, TypeError):
return {process_item(key): process_item(val) for key, val in item.items()} return {process_item(key): process_item(val) for key, val in item.items()}
except: except Exception:
# we try to conserve the iterable class, if not convert to list # we try to conserve the iterable class, if not convert to list
try: try:
return item.__class__([process_item(val) for val in item]) return item.__class__([process_item(val) for val in item])
@ -730,7 +730,7 @@ def from_pickle(data, db_obj=None):
) )
except (AttributeError, TypeError): except (AttributeError, TypeError):
return {process_item(key): process_item(val) for key, val in item.items()} return {process_item(key): process_item(val) for key, val in item.items()}
except: except Exception:
try: try:
# we try to conserve the iterable class if # we try to conserve the iterable class if
# it accepts an iterator # it accepts an iterator
@ -811,7 +811,7 @@ def from_pickle(data, db_obj=None):
(process_item(key), process_tree(val, dat)) for key, val in item.items() (process_item(key), process_tree(val, dat)) for key, val in item.items()
) )
return dat return dat
except: except Exception:
try: try:
# we try to conserve the iterable class if it # we try to conserve the iterable class if it
# accepts an iterator # accepts an iterator
@ -882,7 +882,7 @@ def from_pickle(data, db_obj=None):
(process_item(key), process_tree(val, dat)) for key, val in data.items() (process_item(key), process_tree(val, dat)) for key, val in data.items()
) )
return dat return dat
except: except Exception:
try: try:
# we try to conserve the iterable class if it # we try to conserve the iterable class if it
# accepts an iterator # accepts an iterator