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 authored and ingydotnet committed Sep 22, 2021
1 parent 56644b3 commit 34e764f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/yaml/representer.py
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
@@ -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
Expand Up @@ -3,3 +3,4 @@
- !!python/name:yaml.dump
- !!python/name:abs
- !!python/module:yaml.tokens
- !!python/name:signal.Handlers
3 changes: 3 additions & 0 deletions tests/lib/test_constructor.py
Expand Up @@ -5,6 +5,9 @@
import datetime
import yaml.tokens

# Import any packages here that need to be referenced in .code files.
import signal

def execute(code):
global value
exec(code)
Expand Down

0 comments on commit 34e764f

Please sign in to comment.