summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
AgeCommit message (Collapse)AuthorLines
2019-01-31bpo-35766: Merge typed_ast back into CPython (GH-11645)Guido van Rossum-0/+2
2018-11-29bpo-30167: Remove __cached__ from __main__ when removing __file__ (GH-7415)INADA Naoki-2/+8
2018-11-22bpo-35177, Python-ast.h: Fix "Yield" compiler warning (GH-10664)Victor Stinner-0/+1
Partially revert commit 5f2df88b63e50d23914e97ec778861a52abdeaad: add "#undef Yield" to .c files after including Python-ast.h. Fix the warning: winbase.h(102): warning C4005: 'Yield': macro redefinition
2018-11-12bpo-35081: Rename internal headers (GH-10275)Victor Stinner-1/+1
Rename Include/internal/ headers: * pycore_hash.h -> pycore_pyhash.h * pycore_lifecycle.h -> pycore_pylifecycle.h * pycore_mem.h -> pycore_pymem.h * pycore_state.h -> pycore_pystate.h Add missing headers to Makefile.pre.in and PCbuild: * pycore_condvar.h. * pycore_hamt.h * pycore_pyhash.h
2018-11-12bpo-35177: Add dependencies between header files (GH-10361)Victor Stinner-1/+0
* ast.h now includes Python-ast.h and node.h * parsetok.h now includes node.h and grammar.h * symtable.h now includes Python-ast.h * Modify asdl_c.py to enhance Python-ast.h: * Add #ifndef/#define Py_PYTHON_AST_H to be able to include the header twice * Add "extern { ... }" for C++ * Undefine "Yield" macro conflicting with winbase.h * Remove "#undef Yield" from C files, it's now done in Python-ast.h * Remove now useless includes in C files
2018-11-01bpo-35081: Add pycore_ prefix to internal header files (GH-10263)Victor Stinner-1/+1
* Rename Include/internal/ header files: * pyatomic.h -> pycore_atomic.h * ceval.h -> pycore_ceval.h * condvar.h -> pycore_condvar.h * context.h -> pycore_context.h * pygetopt.h -> pycore_getopt.h * gil.h -> pycore_gil.h * hamt.h -> pycore_hamt.h * hash.h -> pycore_hash.h * mem.h -> pycore_mem.h * pystate.h -> pycore_state.h * warnings.h -> pycore_warnings.h * PCbuild project, Makefile.pre.in, Modules/Setup: add the Include/internal/ directory to the search paths of header files. * Update includes. For example, replace #include "internal/mem.h" with #include "pycore_mem.h".
2018-09-13bpo-34653: Removed unused function PyParser_SimpleParseStringFilename. (GH-9260)Eric V. Smith-6/+0
This function was not in any .h file and was not used by Python, so removing it is safe. https://bugs.python.org/issue34653
2018-09-12closes bpo-34646: Remove PyAPI_* macros from declarations. (GH-9218)Benjamin Peterson-16/+16
2018-08-03bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592)Victor Stinner-6/+2
sys_setcheckinterval() now uses a local variable to parse arguments, before writing into interp->check_interval.
2018-07-23bpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. ↵Serhiy Storchaka-0/+4
(GH-8262)
2018-07-11bpo-34080: Fix a memory leak in the compiler. (GH-8222)Serhiy Storchaka-1/+1
2018-07-03bpo-24596: Decref module in PyRun_SimpleFileExFlags() on SystemExit (GH-7918)Zackery Spytz-1/+2
PyErr_Print() will not return when the exception is a SystemExit, so decref the __main__ module object in that case.
2018-06-24bpo-33451: Close pyc files before calling PyEval_EvalCode() (GH-7884)Zackery Spytz-6/+9
Directly executed pyc files were being kept open longer than necessary.
2018-06-15bpo-33818: PyExceptionClass_Name() will now return "const char *". (GH-7581)Serhiy Storchaka-2/+2
2017-12-09closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson-1/+2
Python now supports checking bytecode cache up-to-dateness with a hash of the source contents rather than volatile source metadata. See the PEP for details. While a fairly straightforward idea, quite a lot of code had to be modified due to the pervasiveness of pyc implementation details in the codebase. Changes in this commit include: - The core changes to importlib to understand how to read, validate, and regenerate hash-based pycs. - Support for generating hash-based pycs in py_compile and compileall. - Modifications to our siphash implementation to support passing a custom key. We then expose it to importlib through _imp. - Updates to all places in the interpreter, standard library, and tests that manually generate or parse pyc files to grok the new format. - Support in the interpreter command line code for long options like --check-hash-based-pycs. - Tests and documentation for all of the above.
2017-11-20bpo-32030: Add more options to _PyCoreConfig (#4485)Victor Stinner-1/+5
Py_Main() now handles two more -X options: * -X showrefcount: new _PyCoreConfig.show_ref_count field * -X showalloccount: new _PyCoreConfig.show_alloc_count field
2017-11-12bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160)xdegaye-18/+42
2017-11-11Add the const qualifier to "char *" variables that refer to literal strings. ↵Serhiy Storchaka-1/+1
(#4370)
2017-10-23bpo-30817: Fix PyErr_PrintEx() when no memory (#2526)xdegaye-3/+9
2017-10-18bpo-28603: Fix formatting tracebacks for unhashable exceptions (#4014)Zane Bitter-3/+18
2017-09-14bpo-30860: Fix a refleak. (#3567)Eric Snow-1/+4
Resolves bpo-31420. (This was accidentally reverted when in #3565.)
2017-09-13bpo-31404: Revert "remove modules from Py_InterpreterState (#1638)" (#3565)Eric Snow-4/+1
PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
2017-09-11bpo-30860: Fix a refleak. (#3506)Eric Snow-1/+4
* Drop warnoptions from PyInterpreterState. * Drop xoptions from PyInterpreterState. * Don't set warnoptions and _xoptions again. * Decref after adding to sys.__dict__. * Drop an unused macro. * Check sys.xoptions *before* we delete it.
2017-09-07bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow-0/+1
* group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
2017-05-23bpo-22257: Private C-API for main interpreter initialization (PEP 432). (#1729)Eric Snow-2/+8
(patch by Nick Coghlan)
2017-02-16bpo-29556: Remove unused #include <langinfo.h> (#98)Yen Chi Hsuan-4/+0
bltinmodule.c: Added in b744ba1 and no longer necessary since d64e8a7 posixmodule.c: Added in d1cd4d4 and no longer necessary since efb00c0 pythonrun.c: Added in 73d538b and no longer necessary since d600951 sysmodule.c: Added in 5467d4c and no longer necessary since a2c17c5
2016-12-19Issue #25677: Merge SyntaxError caret positioning from 3.6Martin Panter-1/+1
2016-12-19Issue #25677: Merge SyntaxError caret positioning from 3.5Martin Panter-1/+1
2016-12-11Issue #25677: Correct syntax error caret for indented blocks.Martin Panter-1/+1
Based on patch by Michael Layzell.
2016-11-20Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka-3/+3
UTF-8 represenatation of Unicode objects.
2016-11-20Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka-4/+4
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
2016-11-16Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka-1/+1
The latter function is more readable, faster and doesn't raise exceptions. Based on patch by Xiang Zhang.
2016-11-16Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka-1/+1
The latter function is more readable, faster and doesn't raise exceptions. Based on patch by Xiang Zhang.
2016-09-05Avoid calling functions with an empty string as format stringVictor Stinner-2/+2
Directly pass NULL rather than an empty string.
2016-08-22Rename _PyObject_FastCall() to _PyObject_FastCallDict()Victor Stinner-1/+1
Issue #27809: * Rename _PyObject_FastCall() function to _PyObject_FastCallDict() * Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1() macros calling _PyObject_FastCallDict()
2016-08-20PyErr_PrintEx() now uses fast callVictor Stinner-3/+7
Issue #27128.
2016-05-26Issue #27076: Merge spelling from 3.5Martin Panter-1/+1
2016-05-26Issue #27076: Doc, comment and tests spelling fixesMartin Panter-1/+1
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
2016-02-28Issue #22836: Merge exception reporting from 3.5Martin Panter-1/+7
2016-02-28Issue #22836: Keep exception reports sensible despite errorsMartin Panter-1/+7
2015-12-25Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka-4/+4
private functions.
2015-12-25Issue #25923: Added the const qualifier to static constant arrays.Serhiy Storchaka-2/+2
2015-09-06Issue #15989: Fixed some scarcely probable integer overflows.Serhiy Storchaka-5/+5
It is very unlikely that they can occur in real code for now.
2015-05-02Issue #23911: Move path-based bootstrap code to a separate frozen module.Eric Snow-2/+7
2015-04-13Issue #23731: Implement PEP 488.Brett Cannon-4/+1
The concept of .pyo files no longer exists. Now .pyc files have an optional `opt-` tag which specifies if any extra optimizations beyond the peepholer were applied.
2015-03-18Issue #19428: Handle PyMarshal_Read*() errors in run_pyc_file()Victor Stinner-2/+6
Detect also earlier PyMarshal_Read*() errors in zipimport.
2014-11-21Closes #22869: Move PyOS_CheckStack back to pythonrun.cZachary Ware-0/+37
2014-11-21Issue #22869: Remove duplicate stack check from pythonrun.cSteve Dower-37/+0
2014-11-20Issue #22869: Split pythonrun into two modulesNick Coghlan-1471/+1
- interpreter startup and shutdown code moved to a new pylifecycle.c module - Py_OptimizeFlag moved into the new module with the other global flags
2014-11-05Issue #20597, #21274: Remove unused definition of PATH_MAX on GNU/Hurd,Victor Stinner-4/+0
MAXPATHLEN is now preferred.