summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
Commit message (Collapse)AuthorAgeFilesLines
* 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).
* Py_Initialize(): move the call to _PyImport_FixupExtension() to afterBarry Warsaw1997-09-181-1/+1
| | | | | the phase 2 init of the __builtin__ module, so that multiple interpreters will get the right exceptions.
* PyErr_Print(): When printing a class exception, try to dig out theBarry Warsaw1997-09-161-6/+21
| | | | | __module__ string and if found, print <module>.<class>, unless <module> == "exceptions".
* Fixed some details of printing the str() of an exception. This fixesGuido van Rossum1997-09-051-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.
* Two independent changes (oops):Guido van Rossum1997-08-291-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().
* Added Py_UseClassExceptionsFlag, the variable containing the state ofBarry Warsaw1997-08-291-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.
* PyErr_Print(): Use PyErr_GivenExceptionMatches() instead of pointerBarry Warsaw1997-08-261-2/+4
| | | | compares to test for SystemExit and SyntaxError.
* Added new Py_IsInitalized() API function to test the 'initialized' flag.Guido van Rossum1997-08-221-0/+8
|
* Use a counter instead of a Boolean to check for initialized; n callsGuido van Rossum1997-08-201-5/+5
| | | | to Py_Initialize will be undone by n calls to Py_Uninitialize.
* Merge Py_Cleanup() into Py_Finalize(). Call the various small Fini()Guido van Rossum1997-08-051-36/+43
| | | | functions.
* The last of the mass checkins for separate (sub)interpreters.Guido van Rossum1997-08-021-59/+193
| | | | | | | Everything should now work again. See the comments for the .h files mass checkin (e.g. pystate.h) for more detail.
* Moved some stuff here from main.c (part of a big restructuring - waitGuido van Rossum1997-07-191-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().
* Can't return 0 from void function...Guido van Rossum1997-05-231-1/+1
|
* Py_FlushLine and PyFile_WriteString now return error indicatorsGuido van Rossum1997-05-221-30/+41
| | | | instead of calling PyErr_Clear(). Add checking of those errors.
* Added a space in an error messageGuido van Rossum1997-05-221-1/+1
|
* Instead of importing graminit.h whenever one of the three grammar 'root'Guido van Rossum1997-05-071-4/+3
| | | | symbols is needed, define these in Python.h with a Py_ prefix.
* Keep MS compiler happy: use (int)strlen() when comparing; make sureGuido van Rossum1997-05-061-2/+8
| | | | not to use kill().
* Massive changes for separate thread state management.Guido van Rossum1997-05-051-8/+42
| | | | | All per-thread globals are moved into a struct which is manipulated separately.
* Allow passing a .pyo file.Guido van Rossum1997-04-021-5/+8
| | | | Print correct name in fatal error from PyErr_Print.
* Greatly renamed. Not a very thorough job -- I'm going to restructureGuido van Rossum1997-03-051-210/+211
| | | | it anyway.
* Added new global flag variable Py_InteractiveFlag and new functionGuido van Rossum1997-02-141-1/+22
| | | | | | | Py_FdIsInteractive(). The flag is supposed to be set by the -i command line option. The function is supposed to be called instead of isatty(). This is used for Lee Busby's wish #1, to have an option that pretends stdin is interactive even when it really isn't.
* Keep gcc -Wall happy.Guido van Rossum1996-12-051-0/+4
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Rationalized MS ifdefsGuido van Rossum1996-09-111-2/+2
|
* rename printrefs, getobjects to _Py_ prefixGuido van Rossum1996-05-241-1/+1
|
* Use new names for debug macros. Don't include pythonrun.h.Guido van Rossum1996-05-221-6/+5
|
* Add'l change for NT (Mark H.).Guido van Rossum1996-04-091-0/+1
|
* Moved mac-specific exit handling to macmain.cJack Jansen1995-10-271-21/+4
|
* keep exitfunc alive while calling itGuido van Rossum1995-10-071-0/+2
|
* #undef argument, for the MacGuido van Rossum1995-09-181-0/+1
|
* mac CW-only fix for messy windows upon exitJack Jansen1995-07-291-1/+1
|
* keyword arguments and faster callsGuido van Rossum1995-07-181-10/+3
|
* flush stdout before writing to stderr in print_error()Guido van Rossum1995-03-301-0/+1
|
* fix dusty debugging macrosGuido van Rossum1995-03-291-2/+2
|
* In NT, write fatal() msg to debugging deviceGuido van Rossum1995-03-141-0/+10
|
* mac changes:Jack Jansen1995-02-131-0/+8
| | | | | | - Assume files of types 'PYC ' and 'APPL' are compiled python code - For mwerks, show status line when program has terminated while keeping window open.
* print class name for exceptions that are classesGuido van Rossum1995-02-071-2/+14
|
* Under CodeWarrior, make the window go away on exit(0)Jack Jansen1995-02-021-0/+11
|
* Think C mod to suppress pausing at normal exitGuido van Rossum1995-01-301-0/+8
|