summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
AgeCommit message (Collapse)AuthorLines
2000-07-09Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters-14/+14
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
2000-06-20Add new parser error code, E_OVERFLOW. This error is returned whenJeremy Hylton-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."
2000-05-25Py_Initialize(): Now that standard exceptions are builtin, we don'tBarry Warsaw-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.
2000-05-03Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum-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.)
2000-05-02Py_UseClassExceptionsFlag is deprecated. We keep the C variable for CBarry Warsaw-1/+1
API consistency, but nothing sets it or checks it now.
2000-05-01Marc-Andre Lemburg:Guido van Rossum-0/+1
Added Py_UnicodeFlag for use by the -U command line option.
2000-04-27Mark Hammond: For Windows debug builds, we now only offer to dumpGuido van Rossum-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.
2000-04-14Fix PR#7 comparisons of recursive objectsJeremy Hylton-0/+2
Note that comparisons of deeply nested objects can still dump core in extreme cases.
2000-03-10Marc-Andre Lemburg: add calls to initialize and finalize Unicode andGuido van Rossum-0/+18
Codec registry.
2000-01-20The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum-0/+4
compilation on NT Alpha. Mostly added casts etc.
1999-07-08Marc-Andre Lemburg discovered that the switch from .pyc to .pyo files,Guido van Rossum-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.
1999-04-07Alas, get rid of the Win specific hack to ask the user to press ReturnGuido van Rossum-47/+0
before exiting when an error happened. This didn't work right when Python is invoked from a daemon.
1999-01-29initmain(): Nailed a memory leak. bimod must be DECREF'd!Barry Warsaw-0/+1
1999-01-27err_input(): Nailed a small memory leak. If the error is E_INTR, theBarry Warsaw-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.
1999-01-08Hack for Windows so that if (1) the exit status is nonzero and (2) weGuido van Rossum-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...
1998-12-15Move the prototype for dump_counts() to before where it is used.Guido van Rossum-4/+4
(This only applies when COUNT_ALLOCS is defined.)
1998-10-07Support PYTHONOPTIMIZE variable; by Marc Lemburg.Guido van Rossum-0/+2
1998-10-01Renamed thread.h to pythread.h.Guido van Rossum-1/+1
1998-10-01On second though, NEXITFUNCS should be defined here and not inGuido van Rossum-1/+1
pystate.h; pystate.h doesn't use it (I thought I wanted to move the array there but that won't work).
1998-09-28Remove redundant definition of NEXITFUNCS.Guido van Rossum-1/+1
(Reported by Jeff Rush.)
1998-08-27Don't release the interpreter lock around PyParser_ParseFile().Guido van Rossum-4/+0
It is needed so that tokenizer.c can use PySys_WriteStderr().
1998-08-13Add DebugBreak() call to Py_FatalError() for Mark Hammond (only onGuido van Rossum-0/+3
Win32 in Debug mode).
1998-04-10Translate E_INDENT to the clearest error message I can think of.Guido van Rossum-0/+3
1998-04-03Make sure that the message "Error in sys.exitfunc:" goes to sys.stderrGuido van Rossum-2/+4
and not to C's stderr.
1998-02-28Fix the handling of errors in Py_FlushLine() in a few places.Guido van Rossum-5/+7
(Basically, the error is cleared... Like almost everywhere else...)
1998-02-06Ehm, three unrelated changes.Guido van Rossum-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).
1998-01-19It seems obvious that when Py_Finalize() decides that there's nothingGuido van Rossum-2/+2
to do, it should not call sys.exitfunc either...
1997-12-08Changed the finalization order again so that the reference countGuido van Rossum-13/+18
printing (when Py_DEBUG is defined) happens while there's still a current thread...
1997-11-25Apply str() to sys.ps1 or sys.ps2 before using them as a prompt, soGuido van Rossum-16/+14
you can assign an object whose str() evaluates to the current directory (or whatever).
1997-11-19Two changes (here we go again :-( ).Guido van Rossum-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.
1997-11-04Undo half of the previous change :-(Guido van Rossum-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.
1997-11-03Two independent changes (alas):Guido van Rossum-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.
1997-10-03Initialize Py_UseClassExceptionsFlag to 1.Guido van Rossum-1/+1
1997-10-03Fix small omission: with all the new code, sys.exit(None) would printGuido van Rossum-0/+2
"None"; this should be equivalent to sys.exit(0).
1997-09-18Py_Initialize(): move the call to _PyImport_FixupExtension() to afterBarry Warsaw-1/+1
the phase 2 init of the __builtin__ module, so that multiple interpreters will get the right exceptions.
1997-09-16PyErr_Print(): When printing a class exception, try to dig out theBarry Warsaw-6/+21
__module__ string and if found, print <module>.<class>, unless <module> == "exceptions".
1997-09-05Fixed some details of printing the str() of an exception. This fixesGuido van Rossum-2/+6
a core dump when __str__() returns a non-string, and plugs a memory leak as well: the result of PyObject_Str() was never DECREFed.
1997-08-29Two independent changes (oops):Guido van Rossum-4/+35
- Changed semantics for initialized flag (again); forget the ref counting, forget the fatal errors -- redundant calls to Py_Initialize() or Py_Finalize() calls are simply ignored. - Automatically import site.py on initialization, unless a flag is set not to do this by main().
1997-08-29Added Py_UseClassExceptionsFlag, the variable containing the state ofBarry Warsaw-5/+106
the -X command line option. Py_Initialize(): Handle the two phase initialization of the built-in module. Py_Finalize(): Handle the two phase finalization of the built-in module. parse_syntax_error(): New function which parses syntax errors that PyErr_Print() will catch. This correctly parses such errors regardless of whether PyExc_SyntaxError is an old-style string exception or new-fangled class exception. PyErr_Print(): Many changes: 1. Normalize the exception. 2. Handle SystemExit exceptions which might be class based. Digs the exit code out of the "code" attribute. String based SystemExit is handled the same as before. 3. Handle SyntaxError exceptions which might be class based. Digs the various information bits out of the instance's attributes (see parse_syntax_error() for details). String based SyntaxError still works too. 4. Don't write the `:' after the exception if the exception is class based and has an empty string str() value.
1997-08-26PyErr_Print(): Use PyErr_GivenExceptionMatches() instead of pointerBarry Warsaw-2/+4
compares to test for SystemExit and SyntaxError.
1997-08-22Added new Py_IsInitalized() API function to test the 'initialized' flag.Guido van Rossum-0/+8
1997-08-20Use a counter instead of a Boolean to check for initialized; n callsGuido van Rossum-5/+5
to Py_Initialize will be undone by n calls to Py_Uninitialize.
1997-08-05Merge Py_Cleanup() into Py_Finalize(). Call the various small Fini()Guido van Rossum-36/+43
functions.
1997-08-02The last of the mass checkins for separate (sub)interpreters.Guido van Rossum-59/+193
Everything should now work again. See the comments for the .h files mass checkin (e.g. pystate.h) for more detail.
1997-07-19Moved some stuff here from main.c (part of a big restructuring - waitGuido van Rossum-1/+26
for more!). - The global flags that can be set from environment variables are now set in Py_Initialize (except the silly Py_SuppressPrint, which no longer exists). This saves duplicate code in frozenmain.c and main.c. - Py_GetProgramName() is now here; added Py_SetProgramName(). An embedding program should no longer provide Py_GetProgramName(), instead it should call Py_SetProgramName() *before* calling Py_Initialize().
1997-05-23Can't return 0 from void function...Guido van Rossum-1/+1
1997-05-22Py_FlushLine and PyFile_WriteString now return error indicatorsGuido van Rossum-30/+41
instead of calling PyErr_Clear(). Add checking of those errors.
1997-05-22Added a space in an error messageGuido van Rossum-1/+1