Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with representing Enum types #556

Merged
merged 1 commit into from Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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