Skip to content

Commit

Permalink
Allow unicode string type for py2
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgirshick committed Aug 20, 2018
1 parent f382098 commit f5bb4f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build
yacs.egg-info
yacs/__pycache__
example/__pycache__
.tox
5 changes: 5 additions & 0 deletions yacs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

# CfgNodes can only contain a limited set of valid types
_VALID_TYPES = {dict, tuple, list, str, int, float, bool}
# py2 allow for str and unicode
try:
_VALID_TYPES = _VALID_TYPES.union({unicode})
except Exception as e:
pass


class CfgNode(dict):
Expand Down

0 comments on commit f5bb4f9

Please sign in to comment.