summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyramid/path.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pyramid/path.py b/pyramid/path.py
index 2b557af5f..10647c073 100644
--- a/pyramid/path.py
+++ b/pyramid/path.py
@@ -44,7 +44,8 @@ def package_of(pkg_or_module):
def caller_package(level=2, caller_module=caller_module):
# caller_module in arglist for tests
module = caller_module(level+1)
- if '__init__.py' in getattr(module, '__file__', ''): # empty at >>>
+ f = getattr(module, '__file__', '')
+ if (('__init__.py' in f) or ('__init__$py' in f)): # empty at >>>
# Module is a package
return module
# Go up one level to get package