summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
Commit message (Collapse)AuthorAgeFilesLines
* Add PyOS_getsig() and PyOS_setsig() -- wrappers around signal() orGuido van Rossum2000-09-161-0/+34
| | | | sigaction() (if HAVE_SIGACTION is defined).
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* PyOS_CheckStack(): Better ANSI'fy this while we're at it.Fred Drake2000-08-311-1/+1
|
* Add a comment explaining the return value of PyOS_CheckStack().Fred Drake2000-08-311-1/+4
|
* Hard to believe Guido compiled this! Function lacked a return stmt.Tim Peters2000-08-271-1/+1
|
* Add three new APIs: PyRun_AnyFileEx(), PyRun_SimpleFileEx(),Guido van Rossum2000-08-271-7/+33
| | | | | | | | | | | | | | 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)
* implements PyOS_CheckStack for Windows and MSVC. this fixes aFredrik Lundh2000-08-271-0/+29
| | | | | | couple of potential stack overflows, including bug #110615. closes patch #101238
* Fix to [ Bug #111165 ] doc-string removal masked by PYTHONOPTIMIZEMarc-André Lemburg2000-08-251-3/+3
|
* Remove the osdefs.h #include; it was not needed in the final version ofFred Drake2000-08-151-1/+0
| | | | my last set of changes.
* When raising a SyntaxError, make a best-effort attempt to set theFred Drake2000-08-151-1/+19
| | | | | | | | filename and lineno attributes, but do not mask the SyntaxError if we fail. This is part of what is needed to close SoruceForge bug #110628 (Jitterbug PR#278).
* Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters2000-07-221-94/+45
| | | | declarations yet, those come later.
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-161-1/+1
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* Include macglue.h for some function prototypes, and renamed a fewJack Jansen2000-07-111-2/+5
| | | | mac-specific functions to have a PyMac_ name.
* Create two new exceptions: IndentationError and TabError. These areFred Drake2000-07-111-4/+25
| | | | | | | used for indentation related errors. This patch includes Ping's improvements for indentation-related error messages. Closes SourceForge patches #100734 and #100856.
* Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters2000-07-091-14/+14
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Add new parser error code, E_OVERFLOW. This error is returned whenJeremy Hylton2000-06-201-0/+3
| | | | | | the number of children of a node exceeds the max possible value for the short that is used to count them. The Python runtime converts this parser error into the SyntaxError "expression too long."
* Py_Initialize(): Now that standard exceptions are builtin, we don'tBarry Warsaw2000-05-251-11/+11
| | | | | | | | | | need two phase init or fini of the builtin module. Change the call of _PyBuiltin_Init_1() to _PyBuiltin_Init(). Add a call to init_exceptions(). Py_Finalize(): Don't call _PyBuiltin_Fini_1(). Instead call fini_exceptions() but move this to before the thread state is cleared.
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-2/+2
| | | | | | | | | | For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
* Py_UseClassExceptionsFlag is deprecated. We keep the C variable for CBarry Warsaw2000-05-021-1/+1
| | | | API consistency, but nothing sets it or checks it now.
* Marc-Andre Lemburg:Guido van Rossum2000-05-011-0/+1
| | | | Added Py_UnicodeFlag for use by the -U command line option.
* Mark Hammond: For Windows debug builds, we now only offer to dumpGuido van Rossum2000-04-271-1/+5
| | | | | | remaining object references if the environment variable PYTHONDUMPREFS exists. The default behaviour caused problems for background or otherwise invisible processes that use the debug build of Python.
* Fix PR#7 comparisons of recursive objectsJeremy Hylton2000-04-141-0/+2
| | | | | Note that comparisons of deeply nested objects can still dump core in extreme cases.
* Marc-Andre Lemburg: add calls to initialize and finalize Unicode andGuido van Rossum2000-03-101-0/+18
| | | | Codec registry.
* The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum2000-01-201-0/+4
| | | | compilation on NT Alpha. Mostly added casts etc.
* Marc-Andre Lemburg discovered that the switch from .pyc to .pyo files,Guido van Rossum1999-07-081-2/+2
| | | | | done by _PyImport_Init(), comes to late to affect the import of exceptions.py by _PyBuiltin_Init_2(). Move _PyImport_Init() up few lines.
* Alas, get rid of the Win specific hack to ask the user to press ReturnGuido van Rossum1999-04-071-47/+0
| | | | | before exiting when an error happened. This didn't work right when Python is invoked from a daemon.
* initmain(): Nailed a memory leak. bimod must be DECREF'd!Barry Warsaw1999-01-291-0/+1
|
* err_input(): Nailed a small memory leak. If the error is E_INTR, theBarry Warsaw1999-01-271-1/+2
| | | | | | | | | v temporary variable was never decref'd. Test this by starting up the interpreter, hitting C-c, then immediately exiting. Same potential leak can occur if error is E_NOMEM, since the return is done in the case block. Added Py_XDECREF(v); to both blocks, just before the return.
* Hack for Windows so that if (1) the exit status is nonzero and (2) weGuido van Rossum1999-01-081-0/+47
| | | | | | | | | think we have our own DOS box (i.e. we're not started from a command line shell), we print a message and wait for the user to hit a key before the DOS box is closed. The hacky heuristic for determining whether we have our *own* DOS box (due to Mark Hammond) is to test whether we're on line zero...
* Move the prototype for dump_counts() to before where it is used.Guido van Rossum1998-12-151-4/+4
| | | | (This only applies when COUNT_ALLOCS is defined.)
* Support PYTHONOPTIMIZE variable; by Marc Lemburg.Guido van Rossum1998-10-071-0/+2
|
* Renamed thread.h to pythread.h.Guido van Rossum1998-10-011-1/+1
|
* On second though, NEXITFUNCS should be defined here and not inGuido van Rossum1998-10-011-1/+1
| | | | | pystate.h; pystate.h doesn't use it (I thought I wanted to move the array there but that won't work).
* Remove redundant definition of NEXITFUNCS.Guido van Rossum1998-09-281-1/+1
| | | | (Reported by Jeff Rush.)
* Don't release the interpreter lock around PyParser_ParseFile().Guido van Rossum1998-08-271-4/+0
| | | | It is needed so that tokenizer.c can use PySys_WriteStderr().
* Add DebugBreak() call to Py_FatalError() for Mark Hammond (only onGuido van Rossum1998-08-131-0/+3
| | | | Win32 in Debug mode).
* Translate E_INDENT to the clearest error message I can think of.Guido van Rossum1998-04-101-0/+3
|
* Make sure that the message "Error in sys.exitfunc:" goes to sys.stderrGuido van Rossum1998-04-031-2/+4
| | | | and not to C's stderr.
* Fix the handling of errors in Py_FlushLine() in a few places.Guido van Rossum1998-02-281-5/+7
| | | | (Basically, the error is cleared... Like almost everywhere else...)
* Ehm, three unrelated changes.Guido van Rossum1998-02-061-3/+31
| | | | | | | | | | | | - Add Py_FrozenFlag, intended to suppress error messages fron getpath.c in frozen binaries. - Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allow 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).
* It seems obvious that when Py_Finalize() decides that there's nothingGuido van Rossum1998-01-191-2/+2
| | | | to do, it should not call sys.exitfunc either...
* Changed the finalization order again so that the reference countGuido van Rossum1997-12-081-13/+18
| | | | | printing (when Py_DEBUG is defined) happens while there's still a current thread...
* Apply str() to sys.ps1 or sys.ps2 before using them as a prompt, soGuido van Rossum1997-11-251-16/+14
| | | | | you can assign an object whose str() evaluates to the current directory (or whatever).
* Two changes (here we go again :-( ).Guido van Rossum1997-11-191-35/+3
| | | | | | | | | | 1) The __builtins__ variable in the __main__ module is set to the __builtin__ module instead of its __dict__. 2) Get rid of the SIGHUP and SIGTERM handlers. They can't be made to work reliably when threads may be in use, they are Unix specific, and Python programmers can now program this functionality is a safer way using the signal module.
* Undo half of the previous change :-(Guido van Rossum1997-11-041-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Setting interp->builtins to the __builtin__ module instead of to its dictionary had the unfortunate side effect of always running in restricted execution mode :-( I will check in a different way of setting __main__.__builtins__ to the __builtin__ module later. Also, there was a typo -- a comment was unfinished, and as a result some finalizations were not being executed. In Bart Simpson style, I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes.
* Two independent changes (alas):Guido van Rossum1997-11-031-19/+16
| | | | | | | | | | | | - The interp->builtins variable (and hence, __main__.__builtins__) is once again initialized to the built-in *module* instead of its dictionary. - The finalization order is once again changed. Signals are finalized relatively early, because (1) it DECREF's the signal handlers, and if a signal handler happens to be a bound method, deleting it could cause problems when there's no current thread around, and (2) we don't want to risk executing signal handlers during finalization.
* Initialize Py_UseClassExceptionsFlag to 1.Guido van Rossum1997-10-031-1/+1
|
* Fix small omission: with all the new code, sys.exit(None) would printGuido van Rossum1997-10-031-0/+2
| | | | "None"; this should be equivalent to sys.exit(0).