Skip to content

Commit 29bbaa5

Browse files
committed
Configurable should watch all config files
We now use the global ImportManager for watching config files, because the configured class may not be the Application itself, but also something which does not have an _imp attribute.
1 parent 982ccd4 commit 29bbaa5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

webware/MiscUtils/Configurable.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,12 @@ def userConfig(self):
141141
if contents.lstrip().startswith('{'):
142142
raise ConfigurationError(
143143
'Configuration via a dict literal is not supported anymore.')
144-
imp = getattr(self, '_imp', None)
145-
if imp:
146-
imp.watchFile(filename)
144+
try:
145+
from ImportManager import ImportManager
146+
ImportManager().watchFile(filename)
147+
except Exception as e:
148+
print('WARNING: Config file', filename, 'cannot be watched:', e)
149+
print()
147150
config = self.configReplacementValues().copy()
148151
try:
149152
exec(contents, config)

0 commit comments

Comments
 (0)