From 601e038028655549d23f8eda1c21cb0034724771 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 19 Nov 2009 23:55:27 +0000 Subject: If pkg_or_module is None, treat it as the __main__ package. --- repoze/bfg/path.py | 2 ++ 1 file changed, 2 insertions(+) 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) -- cgit v1.2.3