Commit Graph

2559 Commits

Author SHA1 Message Date
Martin v. Löwis 6371cd8177 Patch #1733960: Allow T_LONGLONG to accept ints.
Will backport to 2.5.
2007-06-09 07:42:52 +00:00
Neal Norwitz 080b598990 Use macro version of GET_SIZE to avoid Coverity warning (#150) about a possible error. 2007-06-09 04:48:22 +00:00
Georg Brandl e06cf4534f Disallow function calls like foo(None=1).
Backport from py3k rev. 55708 by Guido.
2007-06-07 13:23:24 +00:00
Georg Brandl a5ea68905a Bug #1722484: remove docstrings again when running with -OO. 2007-06-01 11:33:33 +00:00
Neal Norwitz 2fca81cc4c Fix indentation (whitespace only). 2007-05-30 04:53:41 +00:00
Kristján Valur Jónsson 629ec26f63 Include <windows.h> after python.h, so that WINNT is properly set before windows.h is included. Fixes warnings in PC builds. 2007-05-26 19:31:39 +00:00
Neal Norwitz df25efeae9 Add a bunch more deprecation warnings for builtins that are going away in 3.0 2007-05-23 06:58:36 +00:00
Neal Norwitz 8b2bfbc198 Add -3 option to the interpreter to warn about features that are
deprecated and will be changed/removed in Python 3.0.

This patch is mostly from Anthony.  I tweaked some format and added
a little doc.
2007-05-23 06:35:32 +00:00
Georg Brandl 2134e754f2 Patch #1686487: you can now pass any mapping after '**' in function calls. 2007-05-21 20:34:16 +00:00
Collin Winter 6290305e67 Backport PEP 3110's new 'except' syntax to 2.6. 2007-05-18 23:11:24 +00:00
Neal Norwitz f6b0e4dca8 Last try for tweaking the max stack depth. 5000 was the original value,
4000 didn't work either.  1000 does work on Windows.  If 2000 works,
that will hopefully be a reasonable balance.
2007-05-17 07:04:46 +00:00
Neal Norwitz 4f82bc3183 Set the depth to something very small to try to determine if the
crashes on Windows are really due to the stack size or possibly
some other problem.
2007-05-17 06:23:50 +00:00
Neal Norwitz 117ef0863b Reduce the max stack depth to see if this fixes the segfaults on
Windows and some other boxes.  If this is successful, this rev should
be backported.  I'm not sure how close to the limit we should push this.
2007-05-17 06:11:36 +00:00
Neal Norwitz b1a9b37aa8 Fix bug in marshal where bad data would cause a segfault due to
lack of an infinite recursion check.

Contributed by Damien Miller at Google.
2007-05-16 20:05:11 +00:00
Georg Brandl bc1b5f1669 Remove an XXX that is unnecessary. 2007-05-11 09:41:37 +00:00
Kristján Valur Jónsson f030394de3 Fix problems in x64 build that were discovered by the testsuite:
- Reenable modules on x64 that had been disabled aeons ago for Itanium.
- Cleared up confusion about compilers for 64 bit windows.  There is only Itanium and x64.  Added macros MS_WINI64 and MS_WINX64 for those rare cases where it matters, such as the disabling of modules above.
- Set target platform (_WIN32_WINNT and WINVER) to 0x0501 (XP) for x64, and 0x0400 (NT 4.0) otherwise, which are the targeted minimum platforms.
- Fixed thread_nt.h.  The emulated InterlockedCompareExchange function didn´t work on x64, probaby due to the lack of a "volatile" specifier.  Anyway, win95 is no longer a target platform.
- Itertools module used wrong constant to check for overflow in count()
- PyInt_AsSsize_t couldn't deal with attribute error when accessing the __long__ member.
- PyLong_FromSsize_t() incorrectly specified that the operand were unsigned.

With these changes, the x64 passes the testsuite, for those modules present.
2007-05-03 20:27:03 +00:00
Neal Norwitz dc9b32e1ab Handle a couple of uncaught errors. This should be backported 2007-05-03 06:47:18 +00:00
Georg Brandl b8ae3d0138 Actually raise an exception before calling ast_error_finish.
Triggers an assertion otherwise.
2007-05-02 20:02:29 +00:00
Kristján Valur Jónsson f371cb1694 Remove obsolete comment. Importing of .dll files has been discontinued, only .pyd files supported on windows now. 2007-04-25 00:19:26 +00:00
Kristján Valur Jónsson 67387fb4aa Make pythoncore compile cleanly with VisualStudio 2005. Used an explicit typecast to get a 64 bit integer, and undefined the Yield macro that conflicts with winbase.h 2007-04-25 00:17:39 +00:00
Kristján Valur Jónsson 17b8e97e2e Merge change 54909 from release25-maint: Fix several minor issues discovered using code analysis in VisualStudio 2005 Team Edition 2007-04-25 00:10:50 +00:00
Neal Norwitz 68cdf8a6da SF #1701207, Fix bogus assertion (and test it!) 2007-04-16 07:37:55 +00:00
Kristján Valur Jónsson 2f2f57916c Fix a bug when using the __lltrace__ opcode tracer, and a problem sith signed chars in frameobject.c which can occur with opcodes > 127 2007-04-13 22:07:33 +00:00
Georg Brandl 5cb76c19ba Patch #1682205: a TypeError while unpacking an iterable is no longer
masked by a generic one with the message "unpack non-sequence".
2007-03-21 09:00:39 +00:00
Neal Norwitz aa754b70b0 Remove unused file spotted by Paul Hankin 2007-03-21 06:39:48 +00:00
Jeremy Hylton dd2cf1cb84 Clean up formatting of this file.
The file should now follow PEP 7, except that it uses 4 space indents
(in the style of Py3k).  This particular code would be really hard to
read with the regular tab idents.

Other changes:
 - reflow long lines
 - change multi-line conditionals to have test at end of line
2007-03-16 15:59:47 +00:00
Collin Winter 77c67bd585 Patch #1642547: Fix an error/crash when encountering syntax errors in complex if statements.
Will backport.
2007-03-16 04:11:30 +00:00
Collin Winter 47c52a8b60 Inline PyImport_GetModulesReloading(). 2007-03-13 23:02:15 +00:00
Georg Brandl 5240d7416c Patch #1444529: the builtin compile() now accepts keyword arguments.
(backport)
2007-03-13 20:46:32 +00:00
Georg Brandl 3bb156722e Typo and grammar fixes. 2007-03-13 07:23:16 +00:00
Neal Norwitz 75c7c80ee5 Fix some style nits:
* lines too long
  * wrong indentation
  * space after a function name
  * wrong function name in error string
  * simplifying some logic

Also add an error check to PyDict_SetItemString.
2007-03-13 05:31:38 +00:00
Collin Winter 276887b16d Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Will backport.
2007-03-12 16:11:39 +00:00
Georg Brandl 7b9c555520 Bug #1678647: write a newline after printing an exception in any
case, even when converting the value to a string failed.
2007-03-12 14:30:05 +00:00
Georg Brandl 871f1bc601 Backport from Py3k branch:
Patch #1591665: implement the __dir__() special function lookup in PyObject_Dir.

Had to change a few bits of the patch because classobjs and __methods__ are still
in Py2.6.
2007-03-12 13:17:36 +00:00
Georg Brandl 7478096148 Typos. 2007-03-10 07:38:14 +00:00
Georg Brandl aa2321b0f8 Patch #703779: unset __file__ in __main__ after running a file. This
makes the filenames the warning module prints much more sensible when
a PYTHONSTARTUP file is used.
2007-03-07 00:40:28 +00:00
Georg Brandl 49aafc9f2c Variant of patch #697613: don't exit the interpreter on a SystemExit
exception if the -i command line option or PYTHONINSPECT environment
variable is given, but break into the interactive interpreter just like
on other exceptions or normal program exit.
 (backport)
2007-03-07 00:34:46 +00:00
Georg Brandl 098cd69ff9 Bug #1674503: close the file opened by execfile() in an error condition. 2007-03-06 12:17:50 +00:00
Georg Brandl 0fca97a5fb Patch #1674228: when assigning a slice (old-style), check for the
sq_ass_slice instead of the sq_slice slot.
2007-03-05 22:28:08 +00:00
Raymond Hettinger 20e1199fbe Fix embarrassing typo and fix constantification of None 2007-03-02 19:20:46 +00:00
Jeremy Hylton 819de6ce20 tabify
Note that ast.c still has a mix of tabs and spaces, because it
attempts to use four-space indents for more of the new code.
2007-02-27 16:13:23 +00:00
Jeremy Hylton 37075c5ace Fix long-standing bug in name mangling for package imports
Reported by Mike Verdone.
2007-02-27 01:01:59 +00:00
Neal Norwitz f83b751f4b SF #1669182, 2.5 was already fixed. Just assert in 2.6 since string exceptions
are gone.
2007-02-26 23:48:27 +00:00
Neal Norwitz 88516a6039 When printing an unraisable error, don't print exceptions. before the name.
This duplicates the behavior whening normally printing exceptions.
2007-02-26 22:41:45 +00:00
Neal Norwitz 7b7d1c8282 Fix a couple of problems in generating the AST code:
* use %r instead of backticks since backticks are going away in Py3k
 * PyArena_Malloc() already sets PyErr_NoMemory so we don't need to do it again
 * the signature for ast2obj_int incorrectly used a bool, rather than a long
2007-02-26 18:10:47 +00:00
Jeremy Hylton 7c1e347f73 Reformat long lines. 2007-02-26 16:14:51 +00:00
Jeremy Hylton 714b112ae5 Put declarations before code. 2007-02-25 16:01:58 +00:00
Jeremy Hylton c5ceb251b3 Fix crash in exec when unicode filename can't be decoded.
I can't think of an easy way to test this behavior.  It only occurs
when the file system default encoding and the interpreter default
encoding are different, such that you can open the file but not decode
its name.
2007-02-25 15:57:45 +00:00
Brett Cannon 0db62aaf09 Modify Parser/asdl_c.py so that the __version__ number for Python/Python-ast.c
is specified at the top of the file.  Also add a note that Python/Python-ast.c
needs to be committed separately after a change to the AST grammar to capture
the revision number of the change (which is what __version__ is set to).
2007-02-12 03:51:02 +00:00
Brett Cannon d080d4b047 Check in changed Python-ast.c from a cosmetic change to Python.asdl (in
r53731).
2007-02-11 19:44:41 +00:00