| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
(This only applies when COUNT_ALLOCS is defined.)
|
| |
|
| |
|
|
|
|
|
| |
pystate.h; pystate.h doesn't use it (I thought I wanted to move the
array there but that won't work).
|
|
|
|
| |
(Reported by Jeff Rush.)
|
|
|
|
| |
It is needed so that tokenizer.c can use PySys_WriteStderr().
|
|
|
|
| |
Win32 in Debug mode).
|
| |
|
|
|
|
| |
and not to C's stderr.
|
|
|
|
| |
(Basically, the error is cleared... Like almost everywhere else...)
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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).
|
|
|
|
| |
to do, it should not call sys.exitfunc either...
|
|
|
|
|
| |
printing (when Py_DEBUG is defined) happens while there's still a
current thread...
|
|
|
|
|
| |
you can assign an object whose str() evaluates to the current
directory (or whatever).
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
| |
"None"; this should be equivalent to sys.exit(0).
|
|
|
|
|
| |
the phase 2 init of the __builtin__ module, so that multiple
interpreters will get the right exceptions.
|
|
|
|
|
| |
__module__ string and if found, print <module>.<class>, unless
<module> == "exceptions".
|
|
|
|
|
| |
a core dump when __str__() returns a non-string, and plugs a memory
leak as well: the result of PyObject_Str() was never DECREFed.
|
|
|
|
|
|
|
|
|
| |
- 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().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
compares to test for SystemExit and SyntaxError.
|
| |
|
|
|
|
| |
to Py_Initialize will be undone by n calls to Py_Uninitialize.
|
|
|
|
| |
functions.
|
|
|
|
|
|
|
| |
Everything should now work again.
See the comments for the .h files mass checkin (e.g. pystate.h) for
more detail.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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().
|
| |
|
|
|
|
| |
instead of calling PyErr_Clear(). Add checking of those errors.
|
| |
|
|
|
|
| |
symbols is needed, define these in Python.h with a Py_ prefix.
|
|
|
|
| |
not to use kill().
|
|
|
|
|
| |
All per-thread globals are moved into a struct which is manipulated
separately.
|
|
|
|
| |
Print correct name in fatal error from PyErr_Print.
|
|
|
|
| |
it anyway.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|