Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from zopefoundation/patrick-fix-reload
Browse files Browse the repository at this point in the history
Fix Reload issue when module's path ends in .pyc or .pyo
  • Loading branch information
Jim Fulton committed Apr 17, 2014
2 parents 6b55166 + 6aef511 commit 4174db4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bobo/src/boboserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def __init__(self, app, default, modules):
self.mtimes = mtimes = {}
for name in modules.split():
module = sys.modules[name]
mtimes[name] = (module.__file__, os.stat(module.__file__).st_mtime)
filename = module.__file__
if filename[-4:] in (".pyc", ".pyo"):
filename = filename[:-1]
mtimes[name] = (filename, os.stat(filename).st_mtime)

def __call__(self, environ, start_response):
for name, (path, mtime) in sorted(six.iteritems(self.mtimes)):
Expand Down

0 comments on commit 4174db4

Please sign in to comment.