Skip to content

Commit

Permalink
fix TypeError when trying to read .yaml
Browse files Browse the repository at this point in the history
If you'll try to read .yaml file with relative path, for example,
'./settings/local_dev.yaml', than you'll receive an error:
`TypeError: the 'package' argument is required to perform a relative import for './settings/local_dev.yaml'`

Just handle this case.
  • Loading branch information
vlad0337187 authored and drgarcia1986 committed Feb 23, 2019
1 parent 6e7bf16 commit 1b81078
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion simple_settings/strategies/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def is_valid_file(file_name):
try:
importlib.import_module(file_name)
return True
except ImportError:
except (ImportError, TypeError):
return False

@staticmethod
Expand Down

0 comments on commit 1b81078

Please sign in to comment.