summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-03-04 16:07:00 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-03-04 16:07:00 (GMT)
commit435aad878c50ecac3c43e3b528bab29b698e5ba9 (patch)
tree42e08210e67d3016fb46cd3c2e27fd82a195276a /Lib
parent1fcadcef408d788b1896ea3d9b4308c1f4c64d12 (diff)
downloadcpython-435aad878c50ecac3c43e3b528bab29b698e5ba9.zip
cpython-435aad878c50ecac3c43e3b528bab29b698e5ba9.tar.gz
cpython-435aad878c50ecac3c43e3b528bab29b698e5ba9.tar.bz2
Rename importlib.util.set___package__ to set_package.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/importlib/_bootstrap.py8
-rw-r--r--Lib/importlib/test/test_util.py6
-rw-r--r--Lib/importlib/util.py2
3 files changed, 8 insertions, 8 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index a2a29cc..4c13c7a 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -97,7 +97,7 @@ def wrap(new, old):
new.__dict__.update(old.__dict__)
-def set___package__(fxn):
+def set_package(fxn):
"""Set __package__ on the returned module."""
def wrapper(*args, **kwargs):
module = fxn(*args, **kwargs)
@@ -131,7 +131,7 @@ class BuiltinImporter:
return cls if imp.is_builtin(fullname) else None
@classmethod
- @set___package__
+ @set_package
def load_module(cls, fullname):
"""Load a built-in module."""
if fullname not in sys.builtin_module_names:
@@ -160,7 +160,7 @@ class FrozenImporter:
return cls if imp.is_frozen(fullname) else None
@classmethod
- @set___package__
+ @set_package
def load_module(cls, fullname):
"""Load a frozen module."""
if cls.find_module(fullname) is None:
@@ -248,7 +248,7 @@ class _ExtensionFileLoader:
raise ValueError("extension modules cannot be packages")
@check_name
- @set___package__
+ @set_package
def load_module(self, fullname):
"""Load an extension module."""
is_reload = fullname in sys.modules
diff --git a/Lib/importlib/test/test_util.py b/Lib/importlib/test/test_util.py
index 8bd35f1..706128a 100644
--- a/Lib/importlib/test/test_util.py
+++ b/Lib/importlib/test/test_util.py
@@ -63,13 +63,13 @@ class ModuleForLoaderTests(unittest.TestCase):
class SetPackageTests(unittest.TestCase):
- """Tests for importlib.util.set___package__."""
+ """Tests for importlib.util.set_package."""
def verify(self, module, expect):
"""Verify the module has the expected value for __package__ after
- passing through set___package__."""
+ passing through set_package."""
fxn = lambda: module
- wrapped = util.set___package__(fxn)
+ wrapped = util.set_package(fxn)
wrapped()
self.assert_(hasattr(module, '__package__'))
self.assertEqual(expect, module.__package__)
diff --git a/Lib/importlib/util.py b/Lib/importlib/util.py
index 2b6154b..9022ab8 100644
--- a/Lib/importlib/util.py
+++ b/Lib/importlib/util.py
@@ -1,3 +1,3 @@
"""Utility code for constructing importers, etc."""
from ._bootstrap import module_for_loader
-from ._bootstrap import set___package__
+from ._bootstrap import set_package