Skip to content

Commit

Permalink
Merge pull request #679 from ryneeverett/ptpython
Browse files Browse the repository at this point in the history
Support ptpython>=v0.27.
  • Loading branch information
trbs committed May 27, 2015
2 parents 9e86bd8 + cf9240e commit 148825e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions django_extensions/management/commands/shell_plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,13 @@ def run_ipython():

def get_ptpython():
try:
from prompt_toolkit.contrib.repl import embed
from ptpython.repl import embed
except ImportError:
return traceback.format_exc()
tb = traceback.format_exc()
try: # prompt_toolkit < v0.27
from prompt_toolkit.contrib.repl import embed
except ImportError:
return tb

def run_ptpython():
imported_objects = import_objects(options, self.style)
Expand All @@ -261,9 +265,13 @@ def run_ptpython():

def get_ptipython():
try:
from prompt_toolkit.contrib.ipython import embed
from ptpython.ipython import embed
except ImportError:
return traceback.format_exc()
tb = traceback.format_exc()
try: # prompt_toolkit < v0.27
from prompt_toolkit.contrib.ipython import embed
except ImportError:
return tb

def run_ptipython():
imported_objects = import_objects(options, self.style)
Expand Down

0 comments on commit 148825e

Please sign in to comment.