diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-11-19 23:55:27 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-11-19 23:55:27 +0000 |
| commit | 601e038028655549d23f8eda1c21cb0034724771 (patch) | |
| tree | 777789fa9783767b71f738730a49713a19bf8846 | |
| parent | e1e341b5222df0c09bc5fc5c6cb707fbc19194b1 (diff) | |
| download | pyramid-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.py | 2 |
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) |
