# HG changeset patch # User Matthias Bussonnier # Date 1460913664 -7200 # Sun Apr 17 19:21:04 2016 +0200 # Node ID 03976a06ba10f73911204b08854087091e88f58e # Parent d268f108ba8013ded34b85c1a6380c13adf0d264 Enable Deprecation warnings in REPL only. diff -r d268f108ba80 -r 03976a06ba10 Python/pythonrun.c --- a/Python/pythonrun.c Sun Apr 17 16:51:52 2016 +0200 +++ b/Python/pythonrun.c Sun Apr 17 19:21:04 2016 +0200 @@ -108,6 +108,14 @@ Py_XDECREF(v); } err = -1; + + PyRun_SimpleString("import warnings as __Py_temporary_warnings\n" + "import sys as __Py_temporary_sys\n" + "__Py_temporary_warnings.filterwarnings('default',\n" + "\tcategory=DeprecationWarning, module='__main__')\n" + "del __Py_temporary_warnings\n" + "del __Py_temporary_sys"); + for (;;) { ret = PyRun_InteractiveOneObject(fp, filename, flags); _PY_DEBUG_PRINT_TOTAL_REFS();