cpython: 39b9b05c3085 (original) (raw)
Mercurial > cpython
changeset 83229:39b9b05c3085
Close #14439: Python now prints the traceback on runpy failure at startup. [#14439]
Victor Stinner victor.stinner@gmail.com | |
---|---|
date | Wed, 10 Apr 2013 00:27:23 +0200 |
parents | b3168643677b |
children | 1410b7790de6 |
files | Misc/NEWS Modules/main.c |
diffstat | 2 files changed, 8 insertions(+), 2 deletions(-)[+] [-] Misc/NEWS 6 Modules/main.c 4 |
line wrap: on
line diff
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1? Core and Builtins ----------------- +- Issue #14439: Python now prints the traceback on runpy failure at startup. +
- Issue #17469: Fix _Py_GetAllocatedBlocks() and sys.getallocatedblocks() when running on valgrind. @@ -1053,7 +1055,7 @@ IDLE
- Issue #6698: IDLE now opens just an editor window when configured to do so. -- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer +- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer raises an exception.
- Issue #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo. @@ -1092,7 +1094,7 @@ IDLE
- Issue #6698: IDLE now opens just an editor window when configured to do so. -- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer +- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer raises an exception.
- Issue #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo.
--- a/Modules/main.c +++ b/Modules/main.c @@ -167,17 +167,20 @@ static int RunModule(wchar_t *modname, i runpy = PyImport_ImportModule("runpy"); if (runpy == NULL) { fprintf(stderr, "Could not import runpy module\n");
} runmodule = PyObject_GetAttrString(runpy, "_run_module_as_main"); if (runmodule == NULL) { fprintf(stderr, "Could not access runpy._run_module_as_main\n");PyErr_Print();[](#l2.7) return -1;[](#l2.8)
} module = PyUnicode_FromWideChar(modname, wcslen(modname)); if (module == NULL) { fprintf(stderr, "Could not convert module name to unicode\n");PyErr_Print();[](#l2.13) Py_DECREF(runpy);[](#l2.14) return -1;[](#l2.15)
PyErr_Print();[](#l2.20) Py_DECREF(runpy);[](#l2.21) Py_DECREF(runmodule);[](#l2.22) return -1;[](#l2.23)
@@ -186,6 +189,7 @@ static int RunModule(wchar_t *modname, i if (runargs == NULL) { fprintf(stderr, "Could not create arguments for runpy._run_module_as_main\n");
PyErr_Print();[](#l2.28) Py_DECREF(runpy);[](#l2.29) Py_DECREF(runmodule);[](#l2.30) Py_DECREF(module);[](#l2.31)