| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
another class.
Test is run with "regrtest.py -R:: test_compile"
Backport of r62015
|
|
|
|
|
| |
only available if asserts are left in the code, in cases where they
can't be triggered from Python code.
|
|
|
|
|
|
| |
r60579 broke a test test_compile, which seems to test an "implementation detail" IMO.
Also test that this correction does not impact the debugger.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
iteration of a while statement.
The mapping between bytecode offsets and source lines (lnotab) did not contain
an entry for the beginning of the loop.
Now it does, and the lnotab can be a bit larger:
in particular, several statements on the same line generate several entries.
However, this does not bother the settrace function, which will trigger only
one 'line' event.
The lnotab seems to be exactly the same as with python2.4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
optimized the
whole construct away, even when an 'else' clause is present::
while 0:
print("no")
else:
print("yes")
did not generate any code at all.
Now the compiler emits the 'else' block, like it already does for 'if' statements.
Backport of r60265.
|
| |
|
|
|
|
| |
(backport from rev. 58204)
|
|
|
|
| |
(backport from rev. 55732)
|
| |
|
|
|
|
|
|
| |
Fix bug #1565514, SystemError not raised on too many nested blocks.
It seems like this should be a different error than SystemError, but
I don't have any great ideas and SystemError was raised in 2.4 and earlier.
|
|
|
|
| |
(backport from rev. 52129)
|
|
|
|
| |
(backport from rev. 51439)
|
|
|
|
|
|
|
|
|
|
| |
there was no verification that privateobj was a PyString. If it wasn't
a string, this could have allowed a NULL pointer to creep in below and crash.
I wonder if this should be PyString_CheckExact? Must identifiers be strings
or can they be subclasses?
Klocwork #275
|
|
|
|
|
| |
in the byte code and co_consts even if they were not used, ie
immediately popped off the stack.
|
|
|
|
|
|
|
|
|
|
|
|
| |
on each iteration. I'm not positive this is the best way to handle
this. I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly. It would be great if people
that use pdb or tracing could test heavily.
Also:
* Remove dead/duplicated code that wasn't used/necessary
because we already handled the docstring prior to entering the loop.
* add some debugging code into the compiler (#if 0'd out).
|
| |
|
|
|
|
|
|
| |
to stackdepth_walk it will be dereffed.
Not sure if I found with failmalloc or Klockwork #55.
|
| |
|
| |
|
|
|
|
| |
had more than 255 blank lines. Byte codes need to go first, line #s second.
|
|
|
|
| |
started after line 256.
|
| |
|
| |
|
|
|
|
| |
(thanks to Neal for review)
|
| |
|
|
|
|
|
|
|
|
| |
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
still has errors from the casts of asdl_seq_GET to cmpop_ty, but
otherwise it's C++ clean.
|
|
|
|
|
| |
entirely happy with the two new VISIT macros in compile.c, but I
couldn't see a better approach.
|
| |
|
| |
|
|
|
|
| |
Re-enable all the tests in test_trace.py except one. Still not sure that these tests test what they used to test, but they pass. One failing test seems to be caused by undocumented line number table behavior in Python 2.4.
|
| |
|
|
|
|
| |
Reorder compiler_set_lineno() call for consistency.
|
| |
|
|
|
|
| |
continue to be handled correctly
|
|
|
|
|
|
|
| |
Anyway, this is the changes to the with-statement
so that __exit__ must return a true value in order
for a pending exception to be ignored.
The PEP (343) is already updated.
|
|
|
|
| |
Add it back.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Much of the peephole optimizer is now indented badly, but it's about
to be revised anyway.
|
|
|
|
|
| |
in multiple places. This makes compile()/eval()/etc also inherit the
absolute-import codeflag, like division and with-statement already were.
|
|
|
|
| |
Neal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- IMPORT_NAME takes an extra argument from the stack: the relativeness of
the import. Only passed to __import__ when it's not -1.
- __import__() takes an optional 5th argument for the same thing; it
__defaults to -1 (old semantics: try relative, then absolute)
- 'from . import name' imports name (be it module or regular attribute)
from the current module's *package*. Likewise, 'from .module import name'
will import name from a sibling to the current module.
- Importing from outside a package is not allowed; 'from . import sys' in a
toplevel module will not work, nor will 'from .. import sys' in a
(single-level) package.
- 'from __future__ import absolute_import' will turn on the new semantics
for import and from-import: imports will be absolute, except for
from-import with dots.
Includes tests for regular imports and importhooks, parser changes and a
NEWS item, but no compiler-package changes or documentation changes.
|
| |
|
| |
|