Commit Graph

2251 Commits

Author SHA1 Message Date
Martin v. Löwis
ace990cf5a Regenerate. 2006-02-28 00:32:31 +00:00
Brett Cannon
a7446e3438 Check the return code for PyErr_Warn() when warning about raising string
exceptions.  This was triggered when 'warnings' had a filter set to "error"
that caught the string exception deprecation warning.
2006-02-27 23:39:10 +00:00
Tim Peters
a7444f47b2 PyErr_ProgramText(): Grrrrrr.
In a Windows debug build, trying to open a file using
an empty string as the name causes assertion death
inside MS's C runtime code.  We probably need to worm
around that in many places.  I'm worming around it here
to stop the new test_with.py from assert-dying in the
Windows debug build (it calls compile() with an empty
string for "the file name", which indirectly leads to
C-level code in Python trying to fopen("", "r")).
2006-02-27 23:29:46 +00:00
Thomas Wouters
1175c43a12 Clarify C-style exception handling with proper label name. 2006-02-27 22:49:54 +00:00
Thomas Wouters
bfe51ea5c8 Fix assertions. 2006-02-27 22:48:55 +00:00
Guido van Rossum
c2e20744b2 PEP 343 -- the with-statement.
This was started by Mike Bland and completed by Guido
(with help from Neal).

This still needs a __future__ statement added;
Thomas is working on Michael's patch for that aspect.

There's a small amount of code cleanup and refactoring
in ast.c, compile.c and ceval.c (I fixed the lltrace
behavior when EXT_POP is used -- however I had to make
lltrace a static global).
2006-02-27 22:32:47 +00:00
Jeremy Hylton
c7d37264bb Fix parsing of subscriptlist.
(Armin's SF bug report).
d = {}
d[1,] = 1
Now handled correctly
2006-02-27 17:29:29 +00:00
Tim Peters
f4e6928c4d Patch 1413181, by Gabriel Becedillas.
PyThreadState_Delete():  if the auto-GIL-state machinery knows about
the thread state, forget it (since the thread state is being deleted,
continuing to remember it can't help, but can hurt if another thread
happens to get created with the same thread id).

I'll backport to 2.4 next.
2006-02-27 17:15:31 +00:00
Thomas Wouters
8622e93eab And some more cleanup. 2006-02-27 17:14:45 +00:00
Thomas Wouters
106203c6e0 Clean up from-import handling. 2006-02-27 17:05:19 +00:00
Jeremy Hylton
9ebfbf0a43 Simplify ast_for_trailer() in anticipation of more changes. 2006-02-27 16:50:35 +00:00
Thomas Wouters
aa8b6c5855 Fix old not-reading-pep-308-right artifact. 2006-02-27 16:46:22 +00:00
Martin v. Löwis
15e62742fa Revert backwards-incompatible const changes. 2006-02-27 16:46:16 +00:00
Thomas Wouters
fa443cda87 Fix assertion errors in debug build, brought on by PEP 308 patch. 2006-02-27 15:43:57 +00:00
Martin v. Löwis
577b5b960d Create _ast module.
Cleanup Python-ast.c generation.
2006-02-27 15:23:19 +00:00
Thomas Wouters
dca3b9c797 PEP 308 implementation, including minor refdocs and some testcases. It
breaks the parser module, because it adds the if/else construct as well as
two new grammar rules for backward compatibility. If no one else fixes
parsermodule, I guess I'll go ahead and fix it later this week.

The TeX code was checked with texcheck.py, but not rendered. There is
actually a slight incompatibility:

>>> (x for x in lambda:0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: iteration over non-sequence

changes into

>>> (x for x in lambda: 0)
  File "<stdin>", line 1
    (x for x in lambda: 0)
                     ^
SyntaxError: invalid syntax

Since there's no way the former version can be useful, it's probably a
bugfix ;)
2006-02-27 00:24:13 +00:00
Martin v. Löwis
d3a5f53a27 Avoid reinitializing the types twice. 2006-02-27 00:09:50 +00:00
Martin v. Löwis
8d0701daf1 Stop generating empty arrays. 2006-02-26 23:40:20 +00:00
Neal Norwitz
59090a7334 Oops, I forgot to check this in with the change to Grammar/Grammar.
Implement change suggested by Jiwon Seo on python-dev.
['(' gen_for ')'] is redundant with test, so remove it.
2006-02-26 22:29:38 +00:00
Martin v. Löwis
2b366e41c3 Check whether there are flags. 2006-02-26 22:12:35 +00:00
Martin v. Löwis
ce1d5d2527 Fix iterating over cmpop_ty lists. 2006-02-26 20:51:25 +00:00
Martin v. Löwis
bd260da900 Generate code to recursively copy an AST into
a tree of Python objects. Expose this through compile().
2006-02-26 19:42:26 +00:00
Neal Norwitz
9a27617239 Based on discussion with Martin and Thomas on python-checkins
add a Py_SAFE_DOWNCAST() to make the code correct.
2006-02-20 18:57:39 +00:00
Neal Norwitz
20dd93f427 Fix compiler warning on amd64. We can't use zd here since this is
ultimately going to snprintf() not the python string formatter.  Right?
2006-02-19 19:34:15 +00:00
Neal Norwitz
a361bd8dce Fix compiler warning (int vs Py_ssize_t mismatch 2006-02-19 19:31:50 +00:00