Skip to content

Ipython 3 and Ipython 4 compatibility fix #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/sql/magic.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import re
from IPython.core.magic import Magics, magics_class, cell_magic, line_magic, needs_local_scope
from IPython.config.configurable import Configurable
from IPython.utils.traitlets import Bool, Int, Unicode
try: # Ipython 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not possible to check the version instead of try/except?

from traitlets.config.configurable import Configurable
from traitlets import Bool, Int, Unicode
except ImportError: # Ipython 4
from IPython.config.configurable import Configurable
from IPython.utils.traitlets import Bool, Int, Unicode

try:
from pandas.core.frame import DataFrame, Series
except ImportError:
Expand Down