[yt-svn] commit/yt: MatthewTurk: Fixes for IPython version number.
Bitbucket
commits-noreply at bitbucket.org
Sat Jun 23 08:23:52 PDT 2012
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/changeset/756c25de85c7/
changeset: 756c25de85c7
branch: yt
user: MatthewTurk
date: 2012-06-23 17:23:26
summary: Fixes for IPython version number.
affected #: 2 files
diff -r e25bbbcec539a5cb2bd4810da8bbc268f208043b -r 756c25de85c715a91b70101061e9dd7bbf2893cf scripts/iyt
--- a/scripts/iyt
+++ b/scripts/iyt
@@ -28,12 +28,6 @@
else:
api_version = '0.11'
-if IPython.__version__.startswith("0.10"):
- api_version = '0.10'
-elif IPython.__version__.startswith("0.11") or \
- IPython.__version__.startswith("0.12"):
- api_version = '0.11'
-
if api_version == "0.10" and "DISPLAY" in os.environ:
from matplotlib import rcParams
ipbackends = dict(Qt4 = IPython.Shell.IPShellMatplotlibQt4,
diff -r e25bbbcec539a5cb2bd4810da8bbc268f208043b -r 756c25de85c715a91b70101061e9dd7bbf2893cf yt/funcs.py
--- a/yt/funcs.py
+++ b/yt/funcs.py
@@ -26,6 +26,7 @@
import time, types, signal, inspect, traceback, sys, pdb, os
import contextlib
import warnings, struct, subprocess
+from distutils import version
from math import floor, ceil
from yt.utilities.exceptions import *
@@ -231,10 +232,10 @@
"""
import IPython
- if IPython.__version__.startswith("0.10"):
- api_version = '0.10'
- elif IPython.__version__.startswith("0.11"):
- api_version = '0.11'
+ if version.LooseVersion(IPython.__version__) <= version.LooseVersion('0.10'):
+ api_version = '0.10'
+ else:
+ api_version = '0.11'
stack = inspect.stack()
frame = inspect.stack()[num_up]
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list