summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-11-19 23:55:27 +0000
committerChris McDonough <chrism@agendaless.com>2009-11-19 23:55:27 +0000
commit601e038028655549d23f8eda1c21cb0034724771 (patch)
tree777789fa9783767b71f738730a49713a19bf8846
parente1e341b5222df0c09bc5fc5c6cb707fbc19194b1 (diff)
downloadpyramid-601e038028655549d23f8eda1c21cb0034724771.tar.gz
pyramid-601e038028655549d23f8eda1c21cb0034724771.tar.bz2
pyramid-601e038028655549d23f8eda1c21cb0034724771.zip
If pkg_or_module is None, treat it as the __main__ package.
-rw-r--r--repoze/bfg/path.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/repoze/bfg/path.py b/repoze/bfg/path.py
index a578d488b..11fbbcb0e 100644
--- a/repoze/bfg/path.py
+++ b/repoze/bfg/path.py
@@ -21,6 +21,8 @@ def package_name(pkg_or_module):
package name of the package in which the module lives. If this
function is passed a package, return the dotted Python package
name of the package itself."""
+ if pkg_or_module is None:
+ return '__main___'
pkg_filename = pkg_or_module.__file__
pkg_name = pkg_or_module.__name__
splitted = os.path.split(pkg_filename)