From: Tim Vieira Date: Wed, 8 Jan 2014 02:07:21 +0000 (-0500) Subject: remove deprecation warning X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=b51eaffc8eaabf7257df8d920e984c43011c29a0;p=dyna2 remove deprecation warning --- diff --git a/Makefile b/Makefile index cf5c48c..ce9e5e2 100644 --- a/Makefile +++ b/Makefile @@ -75,8 +75,7 @@ sphinxbuild: (cd docs/sphinx; make html) sphinxdoc: sphinxbuild - python -c 'import webbrowser; \ - webbrowser.open("./docs/sphinx/_build/html/index.html")' + python -m webbrowser "./docs/sphinx/_build/html/index.html" doc: sphinxbuild haddock diff --git a/src/Dyna/Backend/Python/utils.py b/src/Dyna/Backend/Python/utils.py index 63bd66b..648b45c 100644 --- a/src/Dyna/Backend/Python/utils.py +++ b/src/Dyna/Backend/Python/utils.py @@ -1,6 +1,14 @@ import re from external.path import path # used by other modules -from IPython.frontend.terminal.embed import InteractiveShellEmbed + +try: + from IPython import embed as ip +except ImportError: + from IPython.frontend.terminal.embed import InteractiveShellEmbed + # interactive IPython shell + ip = InteractiveShellEmbed(banner1 = 'Dropping into IPython\n') + + from config import dynahome, dotdynadir from collections import namedtuple, defaultdict from cStringIO import StringIO @@ -75,10 +83,6 @@ def user_vars(variables): if name.startswith('u') and not name.startswith('u_')) -# interactive IPython shell -ip = InteractiveShellEmbed(banner1 = 'Dropping into IPython\n') - - def get_module(cmd, sub): try: exec 'from %s.%s import %s as m' % (cmd, sub, sub)