From 4f70066a08f5cc5c0ef767950e5b4ff7f696eddb Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Tue, 29 Nov 2011 16:50:27 -0800 Subject: [PATCH] Make paster run use execfile so stack traces are useful. --- r2/r2/commands.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/r2/r2/commands.py b/r2/r2/commands.py index f87c7e7f1..727449b5f 100644 --- a/r2/r2/commands.py +++ b/r2/r2/commands.py @@ -100,12 +100,7 @@ class RunCommand(command.Command): loaded_namespace = {} if self.args[1:]: - cmd = self.args[1] - f = open(cmd); - data = f.read() - f.close() - - exec data in loaded_namespace - + execfile(self.args[1], loaded_namespace) + if self.options.command: exec self.options.command in loaded_namespace