Skip to content

Commit

Permalink
Fix issue with representing Enum types
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom1729 committed Sep 22, 2021
1 parent 23120f8 commit 53177f0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/yaml/representer.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def represent_ordered_dict(self, data):
Representer.add_representer(tuple,
Representer.represent_tuple)

Representer.add_representer(type,
Representer.add_multi_representer(type,
Representer.represent_name)

Representer.add_representer(collections.OrderedDict,
Expand Down
2 changes: 1 addition & 1 deletion tests/data/construct-python-name-module.code
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[str, yaml.Loader, yaml.dump, abs, yaml.tokens]
[str, yaml.Loader, yaml.dump, abs, yaml.tokens, signal.Handlers]
1 change: 1 addition & 0 deletions tests/data/construct-python-name-module.data
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
- !!python/name:yaml.dump
- !!python/name:abs
- !!python/module:yaml.tokens
- !!python/name:signal.Handlers
1 change: 1 addition & 0 deletions tests/lib/test_constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def test_subclass_blacklist_types(data_filename, verbose=False):

test_subclass_blacklist_types.unittest = ['.subclass_blacklist']

import signal
if __name__ == '__main__':
import sys, test_constructor
sys.modules['test_constructor'] = sys.modules['__main__']
Expand Down

0 comments on commit 53177f0

Please sign in to comment.