138 Commits

Author SHA1 Message Date
Benjamin Peterson
e4668aade9 fix misleading indentation (closes #28139) 2016-09-13 21:48:57 -07:00
Martin Panter
3d36f0f712 Spelling and grammar fixes in code comments and documentation 2016-07-28 02:37:04 +00:00
Benjamin Peterson
b6f0d0531b remove casts 2014-08-09 19:39:55 -07:00
Dirkjan Ochtman
9b1d670361 Issue #21591: Handle exec backwards compatibility in the AST builder.
Instead of deferring until runtime. This makes sure we hit the right
conditions in dealing with unqualified exec statements.

Reviewed by Victor Stinner. Test follows in a later commit.
2014-07-29 17:21:39 +02:00
Serhiy Storchaka
79fa98af9e Issue #19656: Running Python with the -3 option now also warns about
non-ascii bytes literals.
2014-06-01 22:13:39 +03:00
Mark Dickinson
b1cc6aa2df Issue #9011: AST creation no longer modifies CST for negated numeric literals. 2012-11-25 17:11:33 +00:00
Amaury Forgeot d'Arc
b1147f5d0a Merged revisions 84209, 84214 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84209 | amaury.forgeotdarc | 2010-08-19 19:43:15 +0200 (jeu., 19 août 2010) | 5 lines

  Check the return values for all functions returning an ast node.
  Failure to do it may result in strange error messages or even crashes,
  in admittedly convoluted cases that are normally syntax errors, like:
      def f(*xx, __debug__): pass
........
  r84214 | amaury.forgeotdarc | 2010-08-19 23:32:38 +0200 (jeu., 19 août 2010) | 3 lines

  Add tests for r84209 (crashes in the Ast builder)
  Also remove one tab, and move a check closer to the possible failure.
........
2010-08-19 21:50:08 +00:00
Benjamin Peterson
947ce58a90 prevent assignment to set literals 2010-06-24 00:12:40 +00:00
Brett Cannon
fa84d923ec Remove two unneeded branches to an 'if' statement by applying De Morgan's Law
and creating a single 'if' statement along with a NULL default value for a
variable.

Also clean up a bunch of whitespace.

Found using Clang's static analyzer.
2010-05-05 20:30:30 +00:00
Brett Cannon
417439e6cd Partially revert the over-reaching r80813. 2010-05-05 20:24:30 +00:00
Brett Cannon
0b03f10afb Remove three unneeded variable assignments.
Found using Clang's static analyzer.
2010-05-05 20:20:19 +00:00
Alexandre Vassalotti
b646547bb4 Issue #2333: Backport set and dict comprehensions syntax. 2010-01-11 22:36:12 +00:00
Alexandre Vassalotti
ee936a2130 Issue #2335: Backport set literals syntax from Python 3.x. 2010-01-09 23:35:54 +00:00
Benjamin Peterson
99a5023c80 improve several corner cases related with argument names in parenthesis
- Fix #7362: give a good error message for parenthesized arguments with
  defaults.

- Add a py3k warning for any parenthesized arguments since those are not allowed
  in Py3.  This warning is not given in tuple unpacking, since that incurs the
  tuple unpacking warning.
2009-11-19 22:54:57 +00:00
Benjamin Peterson
ea0e3b0d60 do a backport of r75928
The added test does not fail without the patch, but we still fix the issue of
surrogates being used in wide builds where they should not be.
2009-10-29 01:49:07 +00:00
Eric Smith
abc9f70381 Removed PyOS_ascii_atof from ast.c, as mentioned in issue 7117. 2009-10-27 18:33:14 +00:00
Benjamin Peterson
7adbb5a35d #7050 fix a SystemError when using tuple unpacking and augmented assignment 2009-10-03 20:23:24 +00:00
Benjamin Peterson
c0ba828857 better col_offsets for "for" statements with tuple unpacking #6704
Patch from Frank Wierzbicki.
2009-08-15 22:59:21 +00:00
Benjamin Peterson
4879c907ce the Slice in x[::] has to have step as None to help the interpreter 2009-07-20 20:28:08 +00:00
Benjamin Peterson
a72be3b325 when no module is given in a 'from' relative import, make ImportFrom.module NULL 2009-06-13 20:23:33 +00:00
Benjamin Peterson
52c4bec76b give a better error message when deleting () 2009-06-13 17:08:53 +00:00
Benjamin Peterson
5d1ff94b9e set Print.values to NULL if there are no values 2009-06-13 16:19:19 +00:00
Benjamin Peterson
d1f5a59edb allow importing from a module named None if it has an 'as' clause 2009-06-13 13:06:21 +00:00
Benjamin Peterson
565e1b6bb7 prevent import statements from assigning to None 2009-06-13 03:46:30 +00:00
Benjamin Peterson
4afbba3d34 keep the slice.step field as NULL if no step expression is given 2009-06-13 01:40:00 +00:00