Skip to content

Commit

Permalink
Merge pull request #1543 from RasaHQ/fix_yaml_import
Browse files Browse the repository at this point in the history
replace old pyaml import
  • Loading branch information
wochinge committed Nov 20, 2018
2 parents 1c762f4 + 675dc8c commit 4e2f6d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rasa_nlu/utils/__init__.py
Expand Up @@ -218,15 +218,15 @@ def read_json_file(filename):

def fix_yaml_loader():
"""Ensure that any string read by yaml is represented as unicode."""
from yaml import Loader, SafeLoader

def construct_yaml_str(self, node):
# Override the default string handling function
# to always return unicode objects
return self.construct_scalar(node)

Loader.add_constructor(u'tag:yaml.org,2002:str', construct_yaml_str)
SafeLoader.add_constructor(u'tag:yaml.org,2002:str', construct_yaml_str)
yaml.Loader.add_constructor(u'tag:yaml.org,2002:str', construct_yaml_str)
yaml.SafeLoader.add_constructor(u'tag:yaml.org,2002:str',
construct_yaml_str)


def replace_environment_variables():
Expand Down

0 comments on commit 4e2f6d6

Please sign in to comment.