From ac48dc22c6396fec08cedff62ca21983fa835ade Mon Sep 17 00:00:00 2001 From: Kernc Date: Tue, 17 Nov 2015 21:48:23 +0100 Subject: [PATCH] Wrap code that can cause a fatal warning in try-except --- pelican/__init__.py | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 5074e182..f27c930b 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -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. ---')