Commit Graph

1223 Commits

Author SHA1 Message Date
Jeremy Hylton e36f77814e This patch introduces an extra pass to the compiler that generates a
symbol table for each top-level compilation unit.  The information in
the symbol table allows the elimination of the later optimize() pass;
the bytecode generation emits the correct opcodes.

The current version passes the complete regression test, but may still
contain some bugs.  It's a fairly substantial revision.  The current
code adds an assert() and a test that may lead to a Py_FatalError().
I expect to remove these before 2.1 beta 1.

The symbol table (struct symtable) is described in comments in the
code.

The changes affects the several com_XXX() functions that were used to
emit LOAD_NAME and its ilk.  The primary interface for this bytecode
is now com_addop_varname() which takes a kind and a name, where kind
is one of VAR_LOAD, VAR_STORE, or VAR_DELETE.

There are many other smaller changes:

- The name mangling code is no longer contained in ifdefs.  There are
  two functions that expose the mangling logical: com_mangle() and
  symtable_mangle().

- The com_error() function can accept NULL for its first argument;
  this is useful with is_constant_false() is called during symbol
  table generation.

- The loop index names used by list comprehensions have been changed
  from __1__ to [1], so that they can not be accessed by Python code.

- in com_funcdef(), com_argdefs() is now called before the body of the
  function is compiled.  This provides consistency with com_lambdef()
  and symtable_funcdef().

- Helpers do_pad(), dump(), and DUMP() are added to aid in debugging
  the compiler.
2001-01-19 03:21:30 +00:00
Guido van Rossum 8dabbf149e Fix for the bug in complex() just reported by Ping. 2001-01-19 02:11:59 +00:00
Guido van Rossum fc5ce61abd SF Patch #103250, by pj99: Optimize a strspn() out of startup.
Minor startup speedup: avoid a call to strspn().
2001-01-19 00:24:06 +00:00
Guido van Rossum d94ade1fcc Add my name to the copyright notice. 2001-01-18 14:50:11 +00:00
Tim Peters 691e0e95de Variant of SF patch 103252: Startup optimize: read *.pyc as string, not with getc(). 2001-01-18 04:39:16 +00:00
Tim Peters 60f42b50d8 Move distributed and duplicated config for stat() and fstat() into pyport.h. 2001-01-18 03:03:16 +00:00
Guido van Rossum 44a6ff6cf4 Get rid of the initialization of _PyCompareState_Key. 2001-01-17 21:27:36 +00:00
Marc-André Lemburg ad7c98e264 This patch adds a new builtin unistr() which behaves like str()
except that it always returns Unicode objects.

A new C API PyObject_Unicode() is also provided.

This closes patch #101664.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-17 17:09:53 +00:00
Guido van Rossum 53451b3fd1 Use rich comparisons in min and max. 2001-01-17 15:47:24 +00:00
Guido van Rossum ac7be6888b Rich comparisons fall-out:
- Use PyObject_RichCompare*() where possible: when comparing
  keyword arguments, in _PyEval_SliceIndex(), and of course in
  cmp_outcome().

Unrelated stuff:

- Removed all trailing whitespace.

- Folded some long lines.
2001-01-17 15:42:30 +00:00
Ka-Ping Yee 2057970601 This patch makes sure that the function name always appears in the error
message, and tries to make the messages more consistent and helpful when
the wrong number of arguments or duplicate keyword arguments are supplied.
Comes with more tests for test_extcall.py and and an update to an error
message in test/output/test_pyexpat.
2001-01-15 22:14:16 +00:00
Jack Jansen 8eb4b56828 Added a separate extension (.carbon.slb) for Carbon dynamic modules. 2001-01-15 16:00:40 +00:00
Guido van Rossum 03df3b3bc1 Neil discovered a bad DECREF on warnoptions, that caused repeated
re-initializing Python (Py_Finalize() followed by Py_Initialize()) to
blow up quickly.  With the DECREF removed I can't get it to fail any
more.  (Except it still leaks, but that's probably a separate issue.)
2001-01-13 22:06:05 +00:00
Fred Drake f1fbc62a8c Update the docstring for apply() so that "args" is marked as optional
(since it is).
2001-01-12 17:05:05 +00:00
Guido van Rossum 18d4d8f71d Two changes to from...import:
1) "from M import X" now works even if M is not a real module; it's
   basically a getattr() operation with AttributeError exceptions
   changed into ImportError.

2) "from M import *" now looks for M.__all__ to decide which names to
   import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
   filters out names starting with '_' as before.  Whether or not
   __all__ exists, there's no restriction on the type of M.
2001-01-12 16:24:03 +00:00
Guido van Rossum ad991775ab (Modified) patch by Ping - SF Patch #102681.
- Make error messages from issubclass() and isinstance() a bit more
  descriptive (Ping, modified by Guido)

- Couple of tiny fixes to other docstrings (Ping)

- Get rid of trailing whitespace (Guido)
2001-01-12 16:03:05 +00:00
Moshe Zadka f5df3834eb Fixed bugs noted by Greg Stein
* x wasn't initialized to NULL
* Did not DECREF result from displayhook function
2001-01-11 11:55:37 +00:00
Greg Stein ceb9b7c700 stdout is sometimes a macro; use "outf" instead.
Submitted by: Mark Favas <m.favas@per.dem.csiro.au>
2001-01-11 09:27:34 +00:00
Moshe Zadka f68f2fec7d Implementation of PEP-0217.
This closes the PEP, and patch 103170
2001-01-11 05:41:27 +00:00
Charles G. Waldman eec72a7fd9 Add missing Py_DECREF in fast_cfunction. Partial fix for SF bug
#127699.
2001-01-10 22:11:59 +00:00
Guido van Rossum fef124346e Oops, one more part of the cygwin patch (SF patch #102409 by jlt63:
Cygwin Python DLL and Shared Extension Patch).  Add module.dll as a
valid extension.

jlt63 writes: Note that his change essentially backs out the fix for
bug #115973. Should ".pyd" be retained instead for posterity?
2001-01-10 21:17:27 +00:00
Guido van Rossum 4c3f57cf05 SF Patch #103154 by jlt63: Cygwin Check Import Case Patch.
Note: I've reordered acconfig.h and config.h.in to obtain alphabetical
order (modulo case and leading _).
2001-01-10 20:40:46 +00:00
Tim Peters b8584e0894 Fix signed/unsigned wng. Unfortunately, (unsigned char) << int
has type int in C.
2001-01-05 00:54:29 +00:00
Fred Drake 1a7aab70d1 When a PyCFunction that takes only positional parameters is called with
an empty keywords dictionary (via apply() or the extended call syntax),
the keywords dict should be ignored.  If the keywords dict is not empty,
TypeError should be raised.  (Between the restructuring of the call
machinery and this patch, an empty dict in this situation would trigger
a SystemError via PyErr_BadInternalCall().)

Added regression tests to detect errors for this.
2001-01-04 22:33:02 +00:00
Martin v. Löwis be4c0f56a2 Recognize pyc files even if they don't end in pyc.
Patch #103067 with modifications as discussed in email.
2001-01-04 20:30:56 +00:00
Neil Schemenauer 23ab199bfd Add NotImplemented to the builtin module. 2001-01-04 01:48:42 +00:00
Jeremy Hylton 5282044be7 Revised implementation of CALL_FUNCTION and friends.
More revision still needed.

Much of the code that was in the mainloop was moved to a series of
helper functions.  PyEval_CallObjectWithKeywords was split into two
parts.  The first part now only does argument handling.  The second
part is now named call_object and delegates the call to a
call_(function,method,etc.) helper.

XXX The call_XXX helper functions should be replaced with tp_call
functions for the respective types.

The CALL_FUNCTION implementation contains three kinds of optimization:
1. fast_cfunction and fast_function are called when the arguments on
   the stack can be passed directly to eval_code2() without copying
   them into a tuple.
2. PyCFunction objects are dispatched immediately, because they are
   presumed to occur more often than anything else.
3. Bound methods are dispatched inline.  The method object contains a
   pointer to the function object that will be called.  The function
   is called from within the mainloop, which may allow optimization #1
   to be used, too.

The extened call implementation -- f(*args) and f(**kw) -- are
implemented as a separate case in the mainloop.  This allows the
common case of normal function calls to execute without wasting time
on checks for extended calls, although it does introduce a small
amount of code duplication.

Also, the unused final argument of eval_code2() was removed.  This is
probably the last trace of the access statement :-).
2001-01-03 23:52:36 +00:00
Andrew M. Kuchling f07aad171a CHange error messages for ord(), using "string" instead of "string or Unicode" 2000-12-23 14:11:28 +00:00
Andrew M. Kuchling 9bcc68c183 Whoops! Two stray characters crept in to my last check-in 2000-12-20 15:07:34 +00:00
Andrew M. Kuchling 34c20cf705 Patch #102955, fixing one of the warnings in bug #121479:
Simplifies ord()'s logic at the cost of some code duplication, removing a
    " `ord' might be used uninitialized in this function" warning
2000-12-20 14:36:56 +00:00
Guido van Rossum 23fff911a2 Add definitions for PySys_ResetWarnOptions() and
PySys_AddWarnOption().
2000-12-15 22:02:05 +00:00
Guido van Rossum cfd42b556b Add PyErr_Warn(). 2000-12-15 21:58:52 +00:00
Guido van Rossum d0977cd670 Add definitions for standard warning category classes (PyExc_Warning
etc.).
2000-12-15 21:58:29 +00:00
Jack Jansen fd0226b327 Use c2pstr() in stead of Pstring() to convert C-strings to
Pascal-strings. Safer, because Pstring converts in-place and the
pathname may be reused later for error messages.
2000-12-12 22:36:57 +00:00
Barry Warsaw 0705028076 vgetargskeywords(): Patch for memory leak identified in bug #119862. 2000-12-11 20:01:55 +00:00
Barry Warsaw b6a54d2a2c _getframe(): New sys module function for getting at the stack frame.
Implements and closes SF patch #102106, with Guido's suggested
documentation changes.
2000-12-06 21:47:46 +00:00
Neil Schemenauer cc343caf41 Make isinstance() more permissive in what types of arguments it
accepts. Clarify exception messages for isinstance() and
issubclass().  Closes bug #124106.
2000-12-04 15:42:11 +00:00
Guido van Rossum 60a1e7fc99 Clarified some of the error messages, esp. "read-only character
buffer" replaced by "string or read-only character buffer".
2000-12-01 12:59:05 +00:00
Guido van Rossum 83fb073a03 Plug a memory leak in com_import_stmt(): the tuple created to hold the
"..." in "from M import ..." was never DECREFed.  Leak reported by
James Slaughter and nailed by Barry, who also provided an earlier
version of this patch.
2000-11-27 22:22:36 +00:00
Tim Peters 102e457a01 SF bug 119622: compile errors due to redundant atof decls. I don't understand
the bug report (for details, look at it), but agree there's no need for Python
to declare atof itself:  we #include stdlib.h, and ANSI C sez atof is declared
there already.
2000-11-14 20:44:53 +00:00
Guido van Rossum 128bcf4520 Fix syntax error. Submitted by Bill Bumgarner. Apparently this is
still in use, for Apple Mac OSX.
2000-11-13 19:45:45 +00:00
Guido van Rossum 215c340aa3 Rip out DOS-8x3 support. 2000-11-13 17:26:32 +00:00
Thomas Wouters 2cffc7d420 Move our own getopt() implementation to _PyOS_GetOpt(), and use it
regardless of whether the system getopt() does what we want. This avoids the
hassle with prototypes and externs, and the check to see if the system
getopt() does what we want. Prefix optind, optarg and opterr with _PyOS_ to
avoid name clashes. Add new include file to define the right symbols. Fix
Demo/pyserv/pyserv.c to include getopt.h itself, instead of relying on
Python to provide it.
2000-11-03 08:18:37 +00:00
Jeremy Hylton 6b4ec5135b Fix for SF bug #117241
When a method is called with no regular arguments and * args, defer
the first arg is subclass check until after the * args have been
expanded.

N.B. The CALL_FUNCTION implementation is getting really hairy; should
review it to see if it can be simplified.
2000-10-30 17:15:20 +00:00
Guido van Rossum c8fcdcba36 Patch 102114, Bug 11725. On OpenBSD (but apparently not on the other
BSDs) you need a leading underscore in the dlsym() lookup name.
2000-10-25 22:07:45 +00:00
Fred Drake 661ea26b3d Ka-Ping Yee <ping@lfw.org>:
Changes to error messages to increase consistency & clarity.

This (mostly) closes SourceForge patch #101839.
2000-10-24 19:57:45 +00:00
Fred Drake 237b5f44c7 Andy Dustman <adustman@users.sourceforge.net>:
Eliminate unused variables to appease compiler.
2000-10-12 20:58:32 +00:00
Thomas Wouters 0be483fd4d Do a better job at staying on-screen :P (Sorry, it's late here.) I'm
assuming here that the ANSI-C adjacent-string-concatenation technique is
allowable, now that Python requires an ANSI C compiler.
2000-10-11 23:26:11 +00:00
Thomas Wouters 8fb62a2e9a Adjust debugging code in the implementation of the DUP_TOPX bytecode, use
Py_FatalError() instead, and clarify the message somewhat. As discussed on
python-dev.
2000-10-11 23:20:09 +00:00
Fred Drake 48fba733b9 Remove the last gcc -Wall warning about possible use of an uninitialized
variable.  w should be initialized before entering the bytecode
interpretation loop since we only need one initialization to satisfy the
compiler.
2000-10-11 13:54:07 +00:00
Tim Peters 35ba689cab Attempt to fix bogus gcc -Wall warnings reported by Marc-Andre Lemburg,
by making the DUP_TOPX code utterly straightforward.  This also gets rid
of all normal-case internal DUP_TOPX if/branches, and allows replacing one
POP() with TOP() in each case, so is a good idea regardless.
2000-10-11 07:04:49 +00:00
Fred Drake e693df94ed Avoid a couple of "value computed is not used" warnings from gcc -Wall;
these computations are required for their side effects in traversing the
variable arguments list.

Reported by Marc-Andre Lemburg <mal@lemburg.com>.
2000-10-10 21:10:35 +00:00
Fred Drake a6c2eb5e1e Donn Cave <donn@u.washington.edu>:
Do not assume that all platforms using a MetroWorks compiler can use
POSIX threads; the assumption breaks on BeOS.  This fix only helps
for BeOS.

This closes SourceForge patch #101772.
2000-10-06 15:48:38 +00:00
Tim Peters 98dc065c1b SF "bug" 115973: patches from Norman Vine so that shared libraries and
Tkinter work under Cygwin.  Accepted on faith & reasonableness.
2000-10-05 19:24:26 +00:00
Mark Hammond 1f7838bcc0 Detect conflicting Python DLL on module import under Windows - as per [ Patch #101676 ] 2000-10-05 10:54:45 +00:00
Barry Warsaw 84294487df _PyImport_Fini(): Closed small memory leak when an embedded app calls
Py_Initialize()/Py_Finalize() in a loop.  _PyImport_Filetab needed to
be deallocated.  Partial closure of SF #110681, Jitterbug PR#398.
2000-10-03 16:02:05 +00:00
Tim Peters 42c83afd14 The 2.0b2 change to write .pyc files in exclusive mode (if possible)
unintentionally caused them to get written in text mode under Windows.
As a result, when .pyc files were later read-- in binary mode --the
magic number was always wrong (note that .pyc magic numbers deliberately
include \r and \n characters, so this was "good" breakage, 100% across
all .pyc files, not random corruption in a subset).  Fixed that.
2000-09-29 04:03:10 +00:00
Fred Drake d5fadf75e4 Rationalize use of limits.h, moving the inclusion to Python.h.
Add definitions of INT_MAX and LONG_MAX to pyport.h.
Remove includes of limits.h and conditional definitions of INT_MAX
and LONG_MAX elsewhere.

This closes SourceForge patch #101659 and bug #115323.
2000-09-26 05:46:01 +00:00
Fred Drake 9e2851566c Andrew Kuchling <akuchlin@mems-exchange.org>:
Add three new convenience functions to the PyModule_*() family:
PyModule_AddObject(), PyModule_AddIntConstant(), PyModule_AddStringConstant().

This closes SourceForge patch #101233.
2000-09-23 03:24:27 +00:00
Marc-André Lemburg 0afff388ce Special case the "s#" PyArg_Parse() token for Unicode objects:
"s#" will now return a pointer to the default encoded string data
of the Unicode object instead of a pointer to the raw UTF-16
data.

The latter is still available via PyObject_AsReadBuffer().

The patch also adds an optimization for string objects which is
based on the fact that string objects return the raw character data
for getreadbuffer access and are always single-segment.
2000-09-21 21:08:30 +00:00
Guido van Rossum 55a8338d7f On Unix, use O_EXCL when creating the .pyc/.pyo files, to avoid a race condition 2000-09-20 20:31:38 +00:00
Marc-André Lemburg d1ba443206 This patch adds a new Python C API called PyString_AsStringAndSize()
which implements the automatic conversion from Unicode to a string
object using the default encoding.

The new API is then put to use to have eval() and exec accept
Unicode objects as code parameter. This closes bugs #110924
and #113890.

As side-effect, the traditional C APIs PyString_Size() and
PyString_AsString() will also accept Unicode objects as
parameters.
2000-09-19 21:04:18 +00:00
Tim Peters e84b74039b Obscure marshal fixes:
When reading a short, sign-extend on platforms where shorts are
    bigger than 16 bits.
    When reading a long, repair the unportable sign extension that was
    being done for 64-bit machines (it assumed that signed right shift
    sign-extends).
2000-09-19 08:54:13 +00:00
Guido van Rossum 9e8181b809 Make better use of GNU Pth -- patch by Andy Dustman.
I can't test this, so I'm just checking it in with blind faith in Andy.
I've tested that it doesn't broeak a non-Pth build on Linux.

Changes include:

- There's a --with-pth configure option.

- Instead of _GNU_PTH, we test for HAVE_PTH.

- Better signal handling.

- (The config.h.in file is regenerated in a slightly different order.)
2000-09-19 00:46:46 +00:00
Marc-André Lemburg 691270feee Deferred the attribute name object type checking to the underlying
PyObject_Set/GetAttr() calls.

This patch fixes bug #113829.
2000-09-18 16:22:27 +00:00
Guido van Rossum 6f25618be5 Add PyOS_getsig() and PyOS_setsig() -- wrappers around signal() or
sigaction() (if HAVE_SIGACTION is defined).
2000-09-16 16:32:19 +00:00
Jack Jansen a454ebd924 Added B format char to Py_BuildValue (same as b,h,i, but makes
bgen-generated code work).
2000-09-15 12:52:19 +00:00
Jack Jansen b763b9d9d5 Cast UCHAR_MAX to int before doing the comparison for overflow of the
B format char.
2000-09-15 12:51:01 +00:00
Fred Drake fd1f1be98d com_continue_stmt(): Improve error message when continue is found
in a try statement in a loop.

This is related to SourceForge bug #110830.
2000-09-08 16:31:24 +00:00
Marc-André Lemburg bbcf2a7c81 This patch hopefully fixes the problem with "es#" and "es" in
PyArg_ParseTupleAndKeywords() and closes bug #113807.
2000-09-08 11:49:37 +00:00
Guido van Rossum f26cda62b6 The GCC version is loooooooooong; put it on a new line. 2000-09-05 04:40:39 +00:00
Guido van Rossum f4d189f70b All right. More uniformity, and extra blank lines. 2000-09-04 01:27:04 +00:00
Guido van Rossum 7ca7b5ac93 Use periods, not semicolons between Copyright and All Rights Reserved. 2000-09-04 01:22:12 +00:00
Vladimir Marangozov 547936c86f Fix the char* vs. const char* mismatch for the argument of aix_loaderror() 2000-09-04 00:54:56 +00:00
Guido van Rossum 76ad68ae6e Change the copyright notice according to CNRI's wishes, with
BeOpen.com added to the front.

(Even if maybe we won't print this long banner at startup, the string
must still be defined for sys.copyright.)
2000-09-03 03:35:50 +00:00
Fredrik Lundh 1fa0b895ec changed \x to consume exactly two hex digits. implements PEP-223
for 8-bit strings.
2000-09-02 20:11:27 +00:00
Tim Peters 412f246024 PyInterpreterState_New is not thread-safe, and the recent fix to _PyPclose
can cause it to get called by multiple threads simultaneously.

Ditto for PyInterpreterState_Delete.

Of the former, the docs say "The interpreter lock need not be held, but may
be held if it is necessary to serialize calls to this function".  This
kinda implies it both is and isn't thread-safe.

Of the latter, the docs merely say "The interpreter lock need not be
held.", and the clause about serializing is absent.

I expect it was *believed* these are both thread-safe, and the bit about
serializing via the global lock was meant as a permission rather than a
caution.

I also expect we've never seen a problem here because the Python core
(prior to the _PyPclose fix) only calls these functions once per run.
The Py_NewInterpreter subsystem exposed by the C API (but not used by
Python itself) also calls them, but that subsystem appears to be very
rarely used.

Whatever, they're both thread-safe now.
2000-09-02 09:16:15 +00:00
Guido van Rossum 8586991099 REMOVED all CWI, CNRI and BeOpen copyright markings.
This should match the situation in the 1.6b1 tree.
2000-09-01 23:29:29 +00:00
Vladimir Marangozov 7bd25be508 Cosmetics on Py_Get/SetRecursionLimit (for the style guide) 2000-09-01 11:07:19 +00:00
Jeremy Hylton b69a27e5b2 code part of patch #100895 by Fredrik Lundh
PyErr_Format computes size of buffer needed rather than relying on
static buffer.
2000-09-01 03:49:47 +00:00
Tim Peters d320c348f8 Revert removal of void from function definition. Guido sez I can take it
out again after we complete switching to C++ <wink>.  Thanks to Greg Stein
for hitting me.
2000-09-01 03:34:26 +00:00
Jeremy Hylton b709df3810 refactor __del__ exception handler into PyErr_WriteUnraisable
add sanity check to gc: if an exception occurs during GC, call
PyErr_WriteUnraisable and then call Py_FatalEror.
2000-09-01 02:47:25 +00:00
Guido van Rossum 349ff6f7e2 Set the recursion limit to 1000 -- 2500 was not enough, let's be
conservative.
2000-09-01 01:52:08 +00:00
Tim Peters 51de6906be Supply missing prototypes for new Py_{Get,Set}RecursionLimit; fixes compiler wngs;
un-analize Get's definition ("void" is needed only in declarations, not defns, &
is generally considered bad style in the latter).
2000-09-01 00:01:58 +00:00
Jeremy Hylton ee5adfbae6 add user-modifiable recursion_limit
ceval.c:
    define recurion_limit (static), default value is 2500
    define Py_GetRecursionLimit and Py_SetRecursionLimit
    raise RuntimeError if limit is exceeded
PC/config.h:
    remove plat-specific definition
sysmodule.c:
    add sys.(get|set)recursionlimit
2000-08-31 19:23:01 +00:00
Fred Drake 592f2d6c85 _PySys_Init(): When setting up sys.version_info, use #if/#elif.../#endif
instead of four #if/#endif blocks.  This shortens the
                code and improves readability.
2000-08-31 15:21:11 +00:00
Fred Drake 399739f79f PyOS_CheckStack(): Better ANSI'fy this while we're at it. 2000-08-31 05:52:44 +00:00
Fred Drake e8de31cbd0 Add a comment explaining the return value of PyOS_CheckStack(). 2000-08-31 05:38:39 +00:00
Paul Prescod e68140dd3c Better error message with UnboundLocalError 2000-08-30 20:25:01 +00:00
Barry Warsaw 093abe005d eval_code2(): Guido provides this patch for his suggested elaboration
of extended print.  If the file object being printed to is None, then
sys.stdout is used.
2000-08-29 04:56:13 +00:00
Thomas Wouters dd13e4f91f Replace the run-time 'future-bytecode-stream-inspection' hack to find out
how 'import' was called with a compiletime mechanism: create either a tuple
of the import arguments, or None (in the case of a normal import), add it to
the code-block constants, and load it onto the stack before calling
IMPORT_NAME.
2000-08-27 20:31:27 +00:00
Tim Peters e868211e10 Hard to believe Guido compiled this! Function lacked a return stmt. 2000-08-27 20:18:17 +00:00
Thomas Wouters e753ef8d1b Re-allow 'import mod.submod as s', and change its meaning to what it should
mean; the same as 'from mod import submod as s'.
2000-08-27 20:16:32 +00:00
Guido van Rossum 0df002c45b Add three new APIs: PyRun_AnyFileEx(), PyRun_SimpleFileEx(),
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-27 19:21:52 +00:00
Fredrik Lundh 2f15b25da2 implements PyOS_CheckStack for Windows and MSVC. this fixes a
couple of potential stack overflows, including bug #110615.

closes patch #101238
2000-08-27 19:15:31 +00:00
Thomas Wouters 0ae722e0a2 Oops, one pop too many. 2000-08-27 19:01:33 +00:00
Guido van Rossum fee3a2dd8c Charles Waldman's patch to reinitialize the interpreter lock after a
fork.  This solves the test_fork1 problem.  (ceval.c, signalmodule.c,
intrcheck.c)

SourceForge: [ Patch #101226 ] make threading fork-safe
2000-08-27 17:34:07 +00:00
Marc-André Lemburg dc3d606bd9 Fix to [ Bug #111165 ] doc-string removal masked by PYTHONOPTIMIZE 2000-08-25 21:00:46 +00:00
Thomas Wouters b59290f5b2 Fix allowable node-types for assignment, need to add 'listmaker'.
(This fix is a bit broken, just as the test already was: the test for
testlist and listmaker are done always, whereas the test for exprlist and
the actual abort() are only done if Py_DEBUG is defined. Suggestions
welcome, I guess ;)
2000-08-25 05:41:11 +00:00
Fred Drake 6d63adfbb7 Improve the exceptions raised by PyErr_BadInternalCall(); adding the
filename and line number of the call site to allow esier debugging.

This closes SourceForge patch #101214.
2000-08-24 22:38:39 +00:00