Commit Graph

589 Commits

Author SHA1 Message Date
Antoine Pitrou 0d5e52d346 Issue #1856: Avoid crashes and lockups when daemon threads run while the
interpreter is shutting down; instead, these threads are now killed when
they try to take the GIL.
2011-05-04 20:02:30 +02:00
Ezio Melotti 3b3499ba69 #11565: Merge with 3.1. 2011-03-16 11:35:38 +02:00
Ezio Melotti 13925008dc #11565: Fix several typos. Patch by Piotr Kasprzyk. 2011-03-16 11:05:33 +02:00
David Malcolm 8ad4cd90e9 Merged revisions 87796 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87796 | david.malcolm | 2011-01-06 12:01:36 -0500 (Thu, 06 Jan 2011) | 6 lines

  Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
  timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
  support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
  only be present on OS X; the former is the correct one for Linux with GCC.
........
2011-01-06 17:36:32 +00:00
David Malcolm f1397ad399 Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
only be present on OS X; the former is the correct one for Linux with GCC.
2011-01-06 17:01:36 +00:00
Martin v. Löwis 4d0d471a80 Merge branches/pep-0384. 2010-12-03 20:14:31 +00:00
Georg Brandl e5b99f0fb3 Remove redundant includes of headers that are already included by Python.h. 2010-11-30 09:41:01 +00:00
Benjamin Peterson 8f67d0893f make hashes always the size of pointers; introduce Py_hash_t #9778 2010-10-17 20:54:53 +00:00
Victor Stinner a00064576a ceval.c: catch recursion error on _PyUnicode_AsString(co->co_filename) 2010-10-13 10:48:55 +00:00
Benjamin Peterson aa7fbd9564 revert r85003, poorly considered; breaks tests 2010-09-25 03:25:42 +00:00
Benjamin Peterson 81437c9025 don't count keyword arguments as positional #9943 2010-09-25 03:14:33 +00:00
Antoine Pitrou 1df1536fb9 Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly
re-created on a subsequent call to Py_Initialize().  The problem (a crash)
wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
2010-09-13 14:16:46 +00:00
Benjamin Peterson e208b7c5b1 typo 2010-09-10 23:53:14 +00:00
Benjamin Peterson d0de25d731 use Py_REFCNT 2010-09-10 23:52:42 +00:00
Benjamin Peterson d2be5b4fe4 remove gil_drop_request in --without-threads 2010-09-10 22:47:02 +00:00
Benjamin Peterson 00ebe2cdc4 use DISPATCH() instead of continue 2010-09-10 22:02:31 +00:00
Amaury Forgeot d'Arc ba117ef7e9 #4617: Previously it was illegal to delete a name from the local
namespace if it occurs as a free variable in a nested block.  This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).

This sample was valid in 2.6, but fails to compile in 3.x without this change::

   >>> def f():
   ...     def print_error():
   ...        print(e)
   ...     try:
   ...        something
   ...     except Exception as e:
   ...        print_error()
   ...        # implicit "del e" here


This sample has always been invalid in Python, and now works::

   >>> def outer(x):
   ...     def inner():
   ...        return x
   ...     inner()
   ...     del x

There is no need to bump the PYC magic number: the new opcode is used
for code that did not compile before.
2010-09-10 21:39:53 +00:00
Antoine Pitrou 74a69fa662 Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced
by the new (and simpler) DUP_TOP_TWO.  Performance isn't changed, but
our bytecode is a bit simplified.  Patch by Demur Rumed.
2010-09-04 18:43:52 +00:00
Victor Stinner 4a3733d160 Issue #9425: save/restore exception on filename encoding
_PyUnicode_AsString() raises an exception on unencodable filename.
2010-08-17 00:39:57 +00:00
Antoine Pitrou 042b128f58 Issue #9203: Computed gotos are now enabled by default on supported
compilers (which are detected by the configure script).  They can still
be disable selectively by specifying --without-computed-gotos.
2010-08-13 21:15:58 +00:00
Benjamin Peterson 20f9c3c50f revert unintended changes 2010-07-20 22:39:34 +00:00
Benjamin Peterson 013783c529 move test_trace.py so as not to conflict with future tests for the trace module 2010-07-20 22:37:19 +00:00
Georg Brandl 0310a83e7f #3071: tell how many values were expected when unpacking too many. 2010-07-10 10:32:36 +00:00
Benjamin Peterson 88968ad380 only take into account positional arguments count in related error messages 2010-06-25 19:30:21 +00:00
Stefan Krah c87901d56c Merged revisions 82181 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r82181 | stefan.krah | 2010-06-23 20:42:39 +0200 (Wed, 23 Jun 2010) | 3 lines

  Issue #8930: Remaining indentation fixes after the Grand Unified Indenting.
........
2010-06-23 18:54:09 +00:00
Stefan Krah b7e1010096 Issue #8930: Remaining indentation fixes after the Grand Unified Indenting. 2010-06-23 18:42:39 +00:00
Benjamin Peterson 08ec84cf72 use atomic structures in non-thread version 2010-05-30 14:49:32 +00:00
Antoine Pitrou 7f14f0d8a0 Recorded merge of revisions 81032 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines

  Recorded merge of revisions 81029 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

    Untabify C files. Will watch buildbots.
  ........
................
2010-05-09 16:14:21 +00:00
Antoine Pitrou f95a1b3c53 Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

  Untabify C files. Will watch buildbots.
........
2010-05-09 15:52:27 +00:00
Benjamin Peterson 70cce42f15 read eval_breaker with atomic api with computed gotos 2010-05-03 21:09:59 +00:00
Jeffrey Yasskin 39370830a9 Make (most of) Python's tests pass under Thread Sanitizer.
http://code.google.com/p/data-race-test/wiki/ThreadSanitizer is a dynamic data
race detector that runs on top of valgrind. With this patch, the binaries at
http://code.google.com/p/data-race-test/wiki/ThreadSanitizer#Binaries pass many
but not all of the Python tests. All of regrtest still passes outside of tsan.

I've implemented part of the C1x atomic types so that we can explicitly mark
variables that are used across threads, and get defined behavior as compilers
advance.

I've added tsan's client header and implementation to the codebase in
dynamic_annotations.{h,c} (docs at
http://code.google.com/p/data-race-test/wiki/DynamicAnnotations).
Unfortunately, I haven't been able to get helgrind and drd to give sensible
error messages, even when I use their client annotations, so I'm not supporting
them.
2010-05-03 19:29:34 +00:00
Antoine Pitrou 8689a10f07 Merged revisions 79555 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79555 | antoine.pitrou | 2010-04-01 18:42:11 +0200 (jeu., 01 avril 2010) | 5 lines

  Issue #8276: PyEval_CallObject() is now only available in macro form.  The
  function declaration, which was kept for backwards compatibility reasons,
  is now removed (the macro was introduced in 1997!).
........
2010-04-01 16:53:15 +00:00
Benjamin Peterson 7588b8b355 nest if for clarity 2010-03-21 21:22:12 +00:00
Benjamin Peterson afcee8b78d count keyword only arguments as part of the total 2010-03-21 21:16:24 +00:00
Benjamin Peterson f3b7a25a21 Merged revisions 78028 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78028 | benjamin.peterson | 2010-02-06 13:40:18 -0600 (Sat, 06 Feb 2010) | 1 line

  remove pointless error checking
........
2010-03-21 21:12:03 +00:00
Benjamin Peterson 232ecb8918 cleanup a bit 2010-03-21 21:08:54 +00:00
Victor Stinner 38c36f8576 Merged revisions 78875 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r78875 | victor.stinner | 2010-03-12 18:00:41 +0100 (ven., 12 mars 2010) | 5 lines

  Issue #6697: use %U format instead of _PyUnicode_AsString(), because
  _PyUnicode_AsString() was not checked for error (NULL).

  The unicode string is no more truncated to 200 or 400 *bytes*.
........
2010-03-21 21:05:53 +00:00
Benjamin Peterson a567a7796b Merged revisions 79205,79219,79228,79230,79232-79233,79235,79237 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79205 | benjamin.peterson | 2010-03-21 12:34:54 -0500 (Sun, 21 Mar 2010) | 1 line

  rewrite a bit
........
  r79219 | benjamin.peterson | 2010-03-21 14:24:08 -0500 (Sun, 21 Mar 2010) | 1 line

  flatten condition
........
  r79228 | benjamin.peterson | 2010-03-21 14:35:39 -0500 (Sun, 21 Mar 2010) | 1 line

  remove pointless condition
........
  r79230 | benjamin.peterson | 2010-03-21 14:39:52 -0500 (Sun, 21 Mar 2010) | 1 line

  co_varnames is certainly a tuple, so let's not waste time finding out
........
  r79232 | benjamin.peterson | 2010-03-21 14:54:56 -0500 (Sun, 21 Mar 2010) | 1 line

  fix import
........
  r79233 | benjamin.peterson | 2010-03-21 14:56:37 -0500 (Sun, 21 Mar 2010) | 1 line

  don't write duplicate tests
........
  r79235 | benjamin.peterson | 2010-03-21 15:21:00 -0500 (Sun, 21 Mar 2010) | 4 lines

  improve error message from passing inadequate number of keyword arguments #6474

  Note this removes the "non-keyword" or "keyword" phrases from these messages.
........
  r79237 | benjamin.peterson | 2010-03-21 15:30:30 -0500 (Sun, 21 Mar 2010) | 1 line

  take into account keyword arguments when passing too many args
........
2010-03-21 21:00:50 +00:00
Victor Stinner 3f1af5c42e Issue #6697: use %U format instead of _PyUnicode_AsString(), because
_PyUnicode_AsString() was not checked for error (NULL).

The unicode string is no more truncated to 200 or 400 *bytes*.
2010-03-12 17:00:41 +00:00
Benjamin Peterson d01444d325 Merged revisions 78766 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r78766 | benjamin.peterson | 2010-03-07 11:10:51 -0600 (Sun, 07 Mar 2010) | 1 line

  prevent generator finalization from invalidating sys.exc_info() #7173
........
2010-03-07 17:14:15 +00:00
Benjamin Peterson ae5f2f4a39 prevent generator finalization from invalidating sys.exc_info() #7173 2010-03-07 17:10:51 +00:00
Benjamin Peterson f8b60b20a5 fix comment 2010-02-11 02:31:04 +00:00
Antoine Pitrou 074e5ed974 Merge in the new GIL. 2009-11-10 19:50:40 +00:00
Mark Dickinson ee2dd4a4e3 Merged revisions 75984 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r75984 | mark.dickinson | 2009-10-31 10:18:44 +0000 (Sat, 31 Oct 2009) | 12 lines

  Merged revisions 75982 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r75982 | mark.dickinson | 2009-10-31 10:11:28 +0000 (Sat, 31 Oct 2009) | 5 lines

    Issue #6603: Fix --with-tsc build failures on x86-64 that resulted
    from a gcc inline assembler peculiarity. (gcc's "A" constraint
    apparently means 'rax or rdx' in 64-bit mode, not edx:eax
    or rdx:rax as one might expect.)
  ........
................
2009-10-31 10:20:38 +00:00
Mark Dickinson a25b1312c9 Merged revisions 75982 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75982 | mark.dickinson | 2009-10-31 10:11:28 +0000 (Sat, 31 Oct 2009) | 5 lines

  Issue #6603: Fix --with-tsc build failures on x86-64 that resulted
  from a gcc inline assembler peculiarity. (gcc's "A" constraint
  apparently means 'rax or rdx' in 64-bit mode, not edx:eax
  or rdx:rax as one might expect.)
........
2009-10-31 10:18:44 +00:00
Ezio Melotti b4d286d04e silence with (void) two warnings about computed and unused value of POP() 2009-10-03 16:14:07 +00:00
Alexandre Vassalotti bfc3099f38 Merged revisions 73750 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73750 | benjamin.peterson | 2009-07-01 19:45:19 -0400 (Wed, 01 Jul 2009) | 1 line

  small optimization: avoid popping the current block until we have to
........
2009-07-21 05:23:51 +00:00
Alexandre Vassalotti 7b82b40a47 Merged revisions 72487-72488,72879 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72487 | jeffrey.yasskin | 2009-05-08 17:51:06 -0400 (Fri, 08 May 2009) | 7 lines

  PyCode_NewEmpty:
  Most uses of PyCode_New found by http://www.google.com/codesearch?q=PyCode_New
  are trying to build an empty code object, usually to put it in a dummy frame
  object. This patch adds a PyCode_NewEmpty wrapper which lets the user specify
  just the filename, function name, and first line number, instead of also
  requiring lots of code internals.
........
  r72488 | jeffrey.yasskin | 2009-05-08 18:23:21 -0400 (Fri, 08 May 2009) | 13 lines

  Issue 5954, PyFrame_GetLineNumber:
  Most uses of PyCode_Addr2Line
  (http://www.google.com/codesearch?q=PyCode_Addr2Line) are just trying to get
  the line number of a specified frame, but there's no way to do that directly.
  Forcing people to go through the code object makes them know more about the
  guts of the interpreter than they should need.

  The remaining uses of PyCode_Addr2Line seem to be getting the line from a
  traceback (for example,
  http://www.google.com/codesearch/p?hl=en#u_9_nDrchrw/pygame-1.7.1release/src/base.c&q=PyCode_Addr2Line),
  which is replaced by the tb_lineno field.  So we may be able to deprecate
  PyCode_Addr2Line entirely for external use.
........
  r72879 | jeffrey.yasskin | 2009-05-23 19:23:01 -0400 (Sat, 23 May 2009) | 14 lines

  Issue #6042:
  lnotab-based tracing is very complicated and isn't documented very well.  There
  were at least 3 comment blocks purporting to document co_lnotab, and none did a
  very good job. This patch unifies them into Objects/lnotab_notes.txt which
  tries to completely capture the current state of affairs.

  I also discovered that we've attached 2 layers of patches to the basic tracing
  scheme. The first layer avoids jumping to instructions that don't start a line,
  to avoid problems in if statements and while loops.  The second layer
  discovered that jumps backward do need to trace at instructions that don't
  start a line, so it added extra lnotab entries for 'while' and 'for' loops, and
  added a special case for backward jumps within the same line. I replaced these
  patches by just treating forward and backward jumps differently.
........
2009-07-21 04:30:03 +00:00
Benjamin Peterson b1715f131f use stack altering macros here 2009-06-28 16:21:52 +00:00
Benjamin Peterson 6d46a91dc0 Merged revisions 73614-73615 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73614 | benjamin.peterson | 2009-06-28 11:08:02 -0500 (Sun, 28 Jun 2009) | 1 line

  add two generic macros for peeking and setting in the stack
........
  r73615 | benjamin.peterson | 2009-06-28 11:14:07 -0500 (Sun, 28 Jun 2009) | 1 line

  use stack macros
........
2009-06-28 16:17:34 +00:00