summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew/3.4.rst
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-06-01 03:18:39 (GMT)
committerBrett Cannon <brett@python.org>2013-06-01 03:18:39 (GMT)
commit3e0651b5fa45031b858556292f5623e264addfd0 (patch)
treecbc860cfd294cb53ce0e37fa9dd320913054fad2 /Doc/whatsnew/3.4.rst
parent0e75c0688673da4fbaceae0b75e20e953751e86a (diff)
downloadcpython-3e0651b5fa45031b858556292f5623e264addfd0.zip
cpython-3e0651b5fa45031b858556292f5623e264addfd0.tar.gz
cpython-3e0651b5fa45031b858556292f5623e264addfd0.tar.bz2
Issue #18065: For frozen packages set __path__ to [].
Previously __path__ was set to [__name__], but that could lead to bad results if someone managed to circumvent the frozen importer and somehow ended up with a finder that thought __name__ was a legit directory/location.
Diffstat (limited to 'Doc/whatsnew/3.4.rst')
-rw-r--r--Doc/whatsnew/3.4.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
index a659fc0..468ba1f 100644
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -259,3 +259,10 @@ that may require changes to your code.
``__package__`` unconditionally to properly support reloading. If this is not
desired then you will need to set these attributes manually. You can use
:func:`importlib.util.module_to_load` for module management.
+
+* Import now resets relevant attributes (e.g. ``__name__``, ``__loader__``,
+ ``__package__``, ``__file__``, ``__cached__``) unconditionally when reloading.
+
+* Frozen packages no longer set ``__path__`` to a list containg the package name
+ but an empty list instead. Determing if a module is a package should be done
+ using ``hasattr(module, '__path__')``.