Created
February 17, 2014 21:30
-
-
Save loisaidasam/9059582 to your computer and use it in GitHub Desktop.
A script to fix that annoying ipython DeprecationWarning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A script to fix that annoying ipython deprecation warning for | |
# "DeprecationWarning: With-statements now directly support multiple context managers" | |
# via https://github.com/matematikaadit/matematikaadit.github.io/issues/29 | |
FILENAME=`ipython locate`/profile_default/startup/00-disable-deprecation-warning.py | |
if [ ! -f $FILENAME ] | |
then | |
FILE=$( cat <<EOF | |
# hide deprecation warning | |
# IPython/terminal/interactiveshell.py:432: | |
# DeprecationWarning: With-statements now directly ... | |
import warnings | |
import exceptions | |
warnings.filterwarnings("ignore", | |
category=exceptions.DeprecationWarning, | |
module='IPython.terminal.interactiveshell', | |
lineno=432) # change lineno to your line number warning | |
EOF | |
) | |
echo "$FILE" > $FILENAME | |
echo "Created $FILENAME" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment