Check if string_names is None before returning string_names (#1708)

* Check if string is None before using string_names

* Add test asserting None string_names returns an empty list

* Remove whitespace to pass flake8

* Add name to authors.txt

Co-authored-by: Leo Ryu <leo@episci.com>
This commit is contained in:
Leo RyuandLeo Ryu authored and GitHub committed 2020-12-12 12:13:31 +01:00
1 parent 42a759a7ae
commit fd435a7bbb
3 files changed
+7

No files matched your search

+3
View File
@@ -179,6 +179,9 @@ class ModuleValue(ModuleMixin, TreeValue):
return self._is_package
def py__package__(self):
if self.string_names is None:
return []
if self._is_package:
return self.string_names
return self.string_names[:-1]