diff --git a/.travis.yml b/.travis.yml index 43c61d01..cd36a234 100644 --- a/.travis.yml +++ b/.travis.yml @@ -91,7 +91,15 @@ notifications: before_script: - echo ./ci/install-julia.sh "$JULIA_VERSION" - ./ci/install-julia.sh "$JULIA_VERSION" - - if [ "$TRAVIS_OS_NAME" = "osx" -a "$PYTHON" = "python3" ]; then brew update; brew upgrade python || echo "Ignoring errors..."; fi + - if [ "$TRAVIS_OS_NAME" = "osx" -a "$PYTHON" = "python3" ]; + then + brew update; + brew upgrade python || echo "Ignoring errors..."; + if ! which $PYTHON; + then + PYTHON="$(ls -1 /usr/local/opt/python@3.*/bin/python3 | head -n1)"; + fi; + fi - if [ "$TRAVIS_OS_NAME" = "osx" -a "$PYTHON" = "python2" ]; then brew update; brew list python@2 &>/dev/null || brew install python@2 || echo "Ignoring errors..."; fi # Ignoring errors from brew since it may actually be OK to do so. # Following which command will catch installation failure: diff --git a/src/julia/magic.py b/src/julia/magic.py index c044e086..37242b5b 100644 --- a/src/julia/magic.py +++ b/src/julia/magic.py @@ -23,12 +23,16 @@ import warnings from IPython.core.magic import Magics, line_cell_magic, magics_class -from IPython.utils import py3compat as compat from traitlets import Bool, Enum from .core import Julia, JuliaError from .tools import redirect_output_streams +try: + unicode +except NameError: + unicode = str + try: from IPython.core.magic import no_var_expand except ImportError: @@ -103,7 +107,7 @@ def julia(self, line, cell=None): Execute code in Julia, and pull some of the results back into the Python namespace. """ - src = compat.unicode_type(line if cell is None else cell) + src = unicode(line if cell is None else cell) # We assume the caller's frame is the first parent frame not in the # IPython module. This seems to work with IPython back to ~v5, and diff --git a/tox.ini b/tox.ini index f0634419..2dd2b161 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ envlist = py3 [testenv] deps = pytest-cov + coverage < 5 extras = test commands =