mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Wrap code that can cause a fatal warning in try-except
This commit is contained in:
parent
9a04ce660c
commit
ac48dc22c6
1 changed files with 20 additions and 19 deletions
|
|
@ -388,26 +388,27 @@ def main():
|
|||
logger.debug('Pelican version: %s', __version__)
|
||||
logger.debug('Python version: %s', sys.version.split()[0])
|
||||
|
||||
pelican, settings = get_instance(args)
|
||||
readers = Readers(settings)
|
||||
|
||||
watchers = {'content': folder_watcher(pelican.path,
|
||||
readers.extensions,
|
||||
pelican.ignore_files),
|
||||
'theme': folder_watcher(pelican.theme,
|
||||
[''],
|
||||
pelican.ignore_files),
|
||||
'settings': file_watcher(args.settings)}
|
||||
|
||||
old_static = settings.get("STATIC_PATHS", [])
|
||||
for static_path in old_static:
|
||||
# use a prefix to avoid possible overriding of standard watchers above
|
||||
watchers['[static]%s' % static_path] = folder_watcher(
|
||||
os.path.join(pelican.path, static_path),
|
||||
[''],
|
||||
pelican.ignore_files)
|
||||
|
||||
try:
|
||||
pelican, settings = get_instance(args)
|
||||
readers = Readers(settings)
|
||||
|
||||
watchers = {'content': folder_watcher(pelican.path,
|
||||
readers.extensions,
|
||||
pelican.ignore_files),
|
||||
'theme': folder_watcher(pelican.theme,
|
||||
[''],
|
||||
pelican.ignore_files),
|
||||
'settings': file_watcher(args.settings)}
|
||||
|
||||
old_static = settings.get("STATIC_PATHS", [])
|
||||
for static_path in old_static:
|
||||
# use a prefix to avoid possible overriding of standard watchers
|
||||
# above
|
||||
watchers['[static]%s' % static_path] = folder_watcher(
|
||||
os.path.join(pelican.path, static_path),
|
||||
[''],
|
||||
pelican.ignore_files)
|
||||
|
||||
if args.autoreload:
|
||||
print(' --- AutoReload Mode: Monitoring `content`, `theme` and'
|
||||
' `settings` for changes. ---')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue