+ oldtime = self.mtimes.get(filename, 0)
+ # Module with no .py file. Skip it.
mtime = os.stat(filename).st_mtime
- if filename in self.mtimes:
- # The file was probably deleted.
+ # Either a module with no .py file, or it's been deleted.
if filename not in self.mtimes:
+ # If a module has no .py file, this will be None.
self.mtimes[filename] = mtime
- if mtime > self.mtimes[filename]:
- # The file has been modified.
+ if mtime is None or mtime > oldtime:
+ # The file has been deleted or modified.
"""Stop the application engine."""