summaryrefslogtreecommitdiff
path: root/pecan/commands/shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'pecan/commands/shell.py')
-rw-r--r--pecan/commands/shell.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pecan/commands/shell.py b/pecan/commands/shell.py
index 8f7a38a..968ded0 100644
--- a/pecan/commands/shell.py
+++ b/pecan/commands/shell.py
@@ -125,9 +125,12 @@ class ShellCommand(BaseCommand):
locs['model'] = model
# insert the pecan locals
- exec(
- 'from pecan import abort, conf, redirect, request, response'
- ) in locs
+ from pecan import abort, conf, redirect, request, response
+ locs['abort'] = abort
+ locs['conf'] = conf
+ locs['redirect'] = redirect
+ locs['request'] = request
+ locs['response'] = response
# prepare the banner
banner = ' The following objects are available:\n'
@@ -153,7 +156,7 @@ class ShellCommand(BaseCommand):
shell = self.SHELLS[self.args.shell]
try:
shell().invoke(locs, banner)
- except ImportError, e:
+ except ImportError as e:
warn((
"%s is not installed, `%s`, "
"falling back to native shell") % (self.args.shell, e),