Skip to content

Commit

Permalink
Inline allow_unicode parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelLefkowitz authored Jul 14, 2022
1 parent e6d0528 commit 55d2805
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/drf_yasg/codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ def yaml_sane_dump(data, binary):
:return: the serialized YAML
:rtype: str or bytes
"""
encoding = None
allow_unicode = None
if binary:
encoding = 'utf-8'
allow_unicode = True
return yaml.dump(
data, Dumper=SaneYamlDumper, default_flow_style=False, encoding=encoding, allow_unicode=allow_unicode)
data,
Dumper=SaneYamlDumper,
default_flow_style=False,
encoding='utf-8' if binary else None,
allow_unicode=binary
)


class SaneYamlLoader(yaml.SafeLoader):
Expand Down

0 comments on commit 55d2805

Please sign in to comment.