summaryrefslogtreecommitdiff
path: root/Lib/importlib
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2013-12-10 22:16:41 -0700
committerEric Snow <ericsnowcurrently@gmail.com>2013-12-10 22:16:41 -0700
commitb282b3d804165d704130fabf0f609d5dd46c1ed2 (patch)
tree99d46706ace4b5596f64302170e52b066c484463 /Lib/importlib
parent85cce1eac7a130412e7673208494f30c04bf4b33 (diff)
downloadcpython-git-b282b3d804165d704130fabf0f609d5dd46c1ed2.tar.gz
Issue #18864: Add a setter for ModuleSpec.has_location.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 6b8f979b8b..baa6c162c6 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -841,6 +841,10 @@ class ModuleSpec:
def has_location(self):
return self._set_fileattr
+ @has_location.setter
+ def has_location(self, value):
+ self._set_fileattr = bool(value)
+
def spec_from_loader(name, loader, *, origin=None, is_package=None):
"""Return a module spec based on various loader methods."""