From 7d8e08ecff656fd0f525a0fd655cdf20915f5fa8 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 5 Oct 2012 14:37:36 -0400 Subject: remove unintended commit --- pyramid/scripts/pserve.py | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py index 533f708fc..9fbf0729a 100644 --- a/pyramid/scripts/pserve.py +++ b/pyramid/scripts/pserve.py @@ -150,8 +150,7 @@ class PServeCommand(object): _reloader_environ_key = 'PYTHON_RELOADER_SHOULD_RUN' _monitor_environ_key = 'PASTE_MONITOR_SHOULD_RUN' - possible_subcommands = ('start', 'stop', 'restart', 'status', - 'handle_reload_error') + possible_subcommands = ('start', 'stop', 'restart', 'status') def __init__(self, argv, quiet=False): self.quiet = quiet @@ -192,34 +191,6 @@ class PServeCommand(object): install_reloader(int(self.options.reload_interval), [app_spec]) # if self.requires_config_file: # watch_file(self.args[0]) - if cmd == 'handle_reload_error': - self.out( - 'There was a reload error: your application did not ' - 'start properly when restarted by the reloader. You ' - 'will need to examine the traceback above, and fix ' - 'the issue. The process will restart after each code ' - 'change until the problem is fixed. In some ' - 'circumstances (such as when there is an ImportError ' - 'raised at module scope), changes you make to the ' - 'offending module will not cause a restart ' - 'and you will need to change the __init__.py ' - 'of your application to force a reload. If that ' - 'does not work, you will need to restart the process ' - 'by hand.') - app_name = self.options.app_name - base = os.getcwd() - vars = self.parse_vars(restvars) - if not self._scheme_re.search(app_spec): - app_spec = 'config:' + app_spec - try: # populate sys.modules - app = self.loadapp( - app_spec, name=app_name, - relative_to=base, global_conf=vars) - except: # but ignore any exceptions - pass - while 1: - time.sleep(1) - else: return self.restart_with_reloader() @@ -555,10 +526,8 @@ class PServeCommand(object): if reloader: # Reloader always exits with code 3; but if we are # a monitor, any exit code will restart - while exit_code != 3: - handle_error_args = args + ['handle_reload_error'] - proc = subprocess.Popen(handle_error_args, env=new_environ) - exit_code = proc.wait() + if exit_code != 3: + return exit_code if self.verbose > 0: self.out('%s %s %s' % ('-' * 20, 'Restarting', '-' * 20)) -- cgit v1.2.3