summaryrefslogtreecommitdiff
path: root/Include/pythonrun.h
AgeCommit message (Collapse)AuthorLines
2001-03-23Add sys.excepthook.Ka-Ping Yee-0/+1
Update docstring and library reference section on 'sys' module. New API PyErr_Display, just for displaying errors, called by excepthook. Uncaught exceptions now call sys.excepthook; if that fails, we fall back to calling PyErr_Display directly. Also comes with sys.__excepthook__ and sys.__displayhook__.
2001-03-22Extend support for from __future__ import nested_scopesJeremy Hylton-0/+13
If a module has a future statement enabling nested scopes, they are also enable for the exec statement and the functions compile() and execfile() if they occur in the module. If Python is run with the -i option, which enters interactive mode after executing a script, and the script it runs enables nested scopes, they are also enabled in interactive mode. XXX The use of -i with -c "from __future__ import nested_scopes" is not supported. What's the point? To support these changes, many function variants have been added to pythonrun.c. All the variants names end with Flags and they take an extra PyCompilerFlags * argument. It is possible that this complexity will be eliminated in a future version of the interpreter in which nested scopes are not optional.
2001-03-01Useful future statement support for the interactive interpreterJeremy Hylton-0/+5
(Also remove warning about module-level global decl, because we can't distinguish from code passed to exec.) Define PyCompilerFlags type contains a single element, cf_nested_scopes, that is true if a nested scopes future statement has been entered at the interactive prompt. New API functions: PyNode_CompileFlags() PyRun_InteractiveOneFlags() -- same as their non Flags counterparts except that the take an optional PyCompilerFlags pointer compile.c: In jcompile() use PyCompilerFlags argument. If cf_nested_scopes is true, compile code with nested scopes. If it is false, but the code has a valid future nested scopes statement, set it to true. pythonrun.c: Create a new PyCompilerFlags object in PyRun_InteractiveLoop() and thread it through to PyRun_InteractiveOneFlags().
2001-02-02Move a bunch of definitions that were internal to compile.c toJeremy Hylton-0/+1
symtable.h, so that they can be used by external module. Improve error handling in symtable_enter_scope(), which return an error code that went unchecked by most callers. XXX The error handling in symtable code is sloppy in general. Modify symtable to record the line number that begins each scope. This can help to identify which code block is being referred to when multiple blocks are bound to the same name. Add st_scopes dict that is used to preserve scope info when PyNode_CompileSymtable() is called. Otherwise, this information is tossed as soon as it is no longer needed. Add Py_SymtableString() to pythonrun; analogous to Py_CompileString().
2000-10-11Use suggested workaround for PyOS_CheckStack causing failure of test_[s]re.pyTrent Mick-1/+1
on Win64. This closes bug http://sourceforge.net/bugs/?func=detailbug&group_id=5470&bug_id=116516
2000-09-16Add typedef PyOS_sighandler_t and prototypes for PyOS_getsig() andGuido van Rossum-0/+6
PyOS_setsig().
2000-09-01REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum-9/+0
This should match the situation in the 1.6b1 tree.
2000-08-27Add three new APIs: PyRun_AnyFileEx(), PyRun_SimpleFileEx(),Guido van Rossum-0/+4
PyRun_FileEx(). These are the same as their non-Ex counterparts but have an extra argument, a flag telling them to close the file when done. Then this is used by Py_Main() and execfile() to close the file after it is parsed but before it is executed. Adding APIs seems strange given the feature freeze but it's the only way I see to close the bug report without incompatible changes. [ Bug #110616 ] source file stays open after parsing is done (PR#209)
2000-08-27implements PyOS_CheckStack for Windows and MSVC. this fixes aFredrik Lundh-1/+13
couple of potential stack overflows, including bug #110615. closes patch #101238
2000-08-07Added a prototype for PyOS_CheckStack (within #ifdef USE_STACKCHECK).Jack Jansen-0/+3
2000-07-09ANSI-fication and Py_PROTO extermination.Fred Drake-56/+56
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
2000-06-26Fredrik Lundh: get rid of warning in pythonrun.cGuido van Rossum-0/+1
2000-05-25Now that standard exceptions are builtin, we don't need two phase initBarry Warsaw-6/+3
or fini of the builtin module. _PyBuiltin_Init_1 => _PyBuiltin_Init _PyBuiltin_Init_2 removed _PyBuiltin_Fini_1 removed _PyBuiltin_Fini_2 removed These functions are used to initialize the _exceptions module. init_exceptions added fini_exceptions added
1998-12-04Add DL_IMPORT(returntype) for all officially exported functions.Guido van Rossum-49/+49
1998-02-06- Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allowGuido van Rossum-0/+4
embedders to force a different PYTHONHOME. - Add new interface PyErr_PrintEx(flag); same as PyErr_Print() but flag determines whether sys.last_* are set or not. PyErr_Print() now simply calls PyErr_PrintEx(1).
1997-08-29Declarations for two phase initialization and finalization functionsBarry Warsaw-2/+4
for the built-in module.
1997-08-22Added new Py_IsInitalized() API function to test the 'initialized' flag.Guido van Rossum-0/+1
1997-08-12Added decls for stuff from myreadline.Guido van Rossum-0/+5
1997-08-12Added prototype for various finalizers.Guido van Rossum-0/+13
1997-08-02Mass checkin (more to follow for other directories).Guido van Rossum-6/+8
Introduce truly separate (sub)interpreter objects. For now, these must be used by separate threads, created from C. See Demo/pysvr for an example of how to use this. This also rationalizes Python's initialization and finalization behavior: Py_Initialize() -- initialize the whole interpreter Py_Finalize() -- finalize the whole interpreter tstate = Py_NewInterpreter() -- create a new (sub)interpreter Py_EndInterpreter(tstate) -- delete a new (sub)interpreter There are also new interfaces relating to threads and the interpreter lock, which can be used to create new threads, and sometimes have to be used to manipulate the interpreter lock when creating or deleting sub-interpreters. These are only defined when WITH_THREAD is defined: PyEval_AcquireLock() -- acquire the interpreter lock PyEval_ReleaseLock() -- release the interpreter lock PyEval_AcquireThread(tstate) -- acquire the lock and make the thread current PyEval_ReleaseThread(tstate) -- release the lock and make NULL current Other administrative changes: - The header file bltinmodule.h is deleted. - The init functions for Import, Sys and Builtin are now internal and declared in pythonrun.h. - Py_Setup() and Py_Cleanup() are no longer declared. - The interpreter state and thread state structures are now linked together in a chain (the chain of interpreters is a static variable in pythonrun.c). - Some members of the interpreter and thread structures have new, shorter, more consistent, names. - Added declarations for _PyImport_{Find,Fixup}Extension() to import.h.
1997-07-19Added declarations for Py_{Set,Get}ProgramName() and a bunch of otherGuido van Rossum-0/+17
Py_Get*() functions.
1997-02-14Added decl for Py_FdIsInteractive.Guido van Rossum-0/+2
1996-10-25New permission notice, includes CNRI.Guido van Rossum-12/+19
1996-05-22Don't declare Py_FatalError.Guido van Rossum-1/+2
Add Py_mport_Init and PyBuiltin_Init.
1995-02-17add Py_FatalErrorGuido van Rossum-0/+2
1995-02-07added callable, removed run_pyc_fileGuido van Rossum-1/+0
1995-01-17new names for lots of new functionsGuido van Rossum-1/+1
1995-01-12The great renaming, phase two: all header files have been updated toGuido van Rossum-16/+16
use the new names exclusively, and the linker will see the new names. Files that import "Python.h" also only see the new names. Files that import "allobjects.h" will continue to be able to use the old names, due to the inclusion (in allobjects.h) of "rename2.h".
1995-01-04Added 1995 copyright.Guido van Rossum-2/+2
object.h: made sizes and refcnts signed ints. stringobject.h: make getstrsize() signed int. methodobject.h: add METH_VARARGS and METH_FREENAME flag bit definitions.
1994-09-14pythonrun.h: added run_pyc_fileGuido van Rossum-0/+1
ceval.h: added Py_AddPendingCall rest: modules using the new naming scheme must now include Python.h
1994-09-07pythgonrun.h: added Py_AtExit().Guido van Rossum-0/+2
rename1.h: add PyArg_GetInt.
1994-08-01Merge alpha100 branch back to main trunkGuido van Rossum-3/+5
1993-11-01* ceval.c, longobject.c, methodobject.c, listnode.c, arraymodule.c,Guido van Rossum-4/+0
pythonrun.c: added static forward declarations * pythonrun.h, ceval.h, longobject.h, node.h: removed declarations of static routines
1993-07-28* Added support for X11 modules.Guido van Rossum-0/+11
* Makefile: change location of FORMS library. * posixmodule.c: turn #if 0 into #ifdef MSDOS (stuff in unistd.h or not) * Almost all .h files: added CPP magic to avoid duplicate inclusions and to support inclusion from C++.
1993-06-17* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.Guido van Rossum-0/+1
Added $(SYSDEF) to its build rule in Makefile. * cgensupport.[ch], modsupport.[ch]: removed some old stuff. Also changed files that still used it... And made several things static that weren't but should have been... And other minor cleanups... * listobject.[ch]: add external interfaces {set,get}listslice * socketmodule.c: fix bugs in new send() argument parsing. * sunaudiodevmodule.c: added flush() and close().
1993-03-30* Fixed some subtleties with fastlocals. You can no longer accessGuido van Rossum-0/+2
f_fastlocals in a traceback object (this is a core dump hazard if there are <nil> entries), but instead eval_code() merges the fast locals back into the locals dictionary if it looks like the local variables will be retained. Also, the merge routines save exceptions since this is sometimes needed (alas!). * Added id() to bltinmodule.c, which returns an object's address (identity). Useful to walk arbitrary data structures containing cycles. * Added compile() to bltinmodule.c and compile_string() to pythonrun.[ch]: support to exec/eval arbitrary code objects. The code that defaults globals and locals is moved from run_node in pythonrun.c (which is now identical to eval_node) to eval_code in ceval.c. [XXX For elegance a clean-up session is necessary.]
1993-03-29* Changed all copyright messages to include 1993.Guido van Rossum-2/+2
* Stubs for faster implementation of local variables (not yet finished) * Added function name to code object. Print it for code and function objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version number has changed accordingly) * Print address of self for built-in methods * New internal functions getattro and setattro (getattr/setattr with string object arg) * Replaced "dictobject" with more powerful "mappingobject" * New per-type functio tp_hash to implement arbitrary object hashing, and hashobject() to interface to it * Added built-in functions hash(v) and hasattr(v, 'name') * classobject: made some functions static that accidentally weren't; added __hash__ special instance method to implement hash() * Added proper comparison for built-in methods and functions
1992-04-05Copyright for 1992 addedGuido van Rossum-1/+1
1991-02-19Added copyright notice.Guido van Rossum-0/+24
1990-12-20"Compiling" versionGuido van Rossum-0/+23