Commit Graph

4901 Commits

Author SHA1 Message Date
Jeremy Hylton 318e167e98 FOR_ITER is a jrel_op() not a plain old def_op() 2001-08-28 15:32:48 +00:00
Jack Jansen 49a806edbb Added list of tests expected to be skipped on the mac. 2001-08-28 14:49:00 +00:00
Jeremy Hylton c59e220000 Handle private names
(Hard to believe these were never handled before)

Add misc.mangle() that mangles based on the rules in compile.c.
XXX Need to test the corner cases

Update CodeGenerator with a class_name attribute bound to None.  If a
particular instance is created within a class scope, the instance's
class_name is bound to that class's name.

Add mangle() method to CodeGenerator that mangles if the class_name
has a class_name in it.

Modify the FunctionCodeGenerator family to handle an extra argument--
the class_name.

Wrap all name ops and attrnames in calls to self.mangle()
2001-08-27 22:56:16 +00:00
Jack Jansen 535c524508 A quick hack to make the test pass on the Mac (similar to the quick hack
to make it pass on Windows:-).
2001-08-27 22:31:58 +00:00
Jeremy Hylton 80ea40d858 emit SET_LINENO for augmented assignments 2001-08-27 21:58:09 +00:00
Jeremy Hylton 2afff324ea Many changes -- bug fixes and sundry improvements
Make nested scopes enabled by default

Add is_constant_false() helper so that compiled code and symbols are
consistent with builtin compiler's handling of "if 0:"

Fix doc string handling to be consistent with recent change that
eliminates the doc string from the Module's node attribute.

Add fix to print handling from Evan & Shane.

Track change to visitor api by making "verbose" explicit.

Comment out setting CO_NESTED flag (it's unnecessary in 2.2).
2001-08-27 21:51:52 +00:00
Tim Peters 9f448150c8 Fix another test still expecting overflow on big int literals. 2001-08-27 21:50:42 +00:00
Tim Peters c15a82813a Change test_overflow to test_no_overflow; looks like big int literals
are auto-coerced to longs now, but this test still expected OverflowError.
I can't imagine this test failure was unique to Windows.
2001-08-27 21:45:32 +00:00
Jeremy Hylton cd8a127e1a Fix for sibling nodes that define the same free variable
Evan Simpson's fix.  And his explanation:

    If you defined two nested functions in a row that refer to the
    same non-global variable, the second one will be generated as
    though the variable were global.
2001-08-27 21:06:35 +00:00
Jeremy Hylton 7e30c9bb5a Add lookup_name() to optimize use of stack frames
The use of com_node() introduces a lot of extra stack frames, enough
to cause a stack overflow compiling test.test_parser with the standard
interpreter recursionlimit.  The com_node() is a convenience function
that hides the dispatch details, but comes at a very high cost.  It is
more efficient to dispatch directly in the callers.  In these cases,
use lookup_node() and call the dispatched node directly.

Also handle yield_stmt in a way that will work with Python 2.1
(suggested by Shane Hathaway)
2001-08-27 21:02:51 +00:00
Jeremy Hylton 058a5adad0 Two changes to visitor API:
Remove _preorder as alias for dispatch and call dispatch directly.
    Add an extra optional argument to walk()

XXX Also comment out some code that does debugging prints.
2001-08-27 20:47:08 +00:00
Jeremy Hylton 6d8c1aabff Add content-type header to ftp URLs (SF patch #454553)
Modify rfc822.formatdate() to always generate English names,
regardless of locale.  This is required by RFC 1123.

In open_local_file() of urllib and urllib2, use new formatdate() from
rfc822.
2001-08-27 20:16:53 +00:00
Tim Peters 9aa70d93aa SF bug [#455775] float parsing discrepancy.
PyTokenizer_Get:  error if exponent contains no digits (3e, 2.0e+, ...).
2001-08-27 19:19:28 +00:00
Jack Jansen e259e5980c Patch by Bill Noon: added 'dylib' as a library type along with
'static' and 'shared'. This fixes extension building for dynamic
Pythons on MacOSX.
2001-08-27 15:08:16 +00:00
Guido van Rossum ea46fa8494 Undo previous checkin -- Barry fixed it better. 2001-08-24 19:46:21 +00:00
Guido van Rossum d320ad08bf Update test output to match new (more informative) error message about
calling unbound method with wrong first argument.
2001-08-24 19:31:43 +00:00
Barry Warsaw 191487351a Quick and dirty fix for test_extcall failures trigged by Guido's
recent classobject.c change.  When calling an unbound method with no
instances as first argument, the error message has changed.  The
message now contains the class name, but the output text being
compared to is too generic, so skip printing it.
2001-08-24 19:11:57 +00:00
Guido van Rossum 70d4491540 Remove the local 'getset' class -- this is now a built-in type with
the same signature.
2001-08-24 18:52:50 +00:00
Barry Warsaw 1e2775f370 Rip the import repr truncation test out of here and put it in test_repr.py 2001-08-24 18:38:02 +00:00
Barry Warsaw 0bcf6d8d54 Added lots of tests for reprs of "simple" objects, such as file,
lambda (anonymous functions?), function, xrange, buffer, cell (need to
fill in), and (some) descriptor types.

Also added a new test case for testing repr truncation fixes.
2001-08-24 18:37:32 +00:00
Tim Peters 16c018d2d2 Repair repr of future-features (wasn't updated to include the new
compiler-flag argument).
2001-08-24 17:13:54 +00:00
Guido van Rossum 9881fc124e supers(): typo -- "if verify" should be "if verbose". 2001-08-24 17:07:20 +00:00
Guido van Rossum c4a1880de4 Add test suite for super(). 2001-08-24 16:55:27 +00:00
Guido van Rossum 76f0cb85c2 Add a test for the new getset type. 2001-08-24 15:24:24 +00:00
Guido van Rossum 833a8d8641 SF patch #454553 by Walter Dörwald: add content-type to FTP URLs, like
for urllib.
2001-08-24 13:10:13 +00:00
Tim Peters 89675078cb Back out trying to use the C values for CO_xxx.
__future__.py reverted to 1.9.
newmodule.c reverted to 2.32.
2001-08-24 06:29:12 +00:00
Tim Peters 4e2fbce71c Looks like someone forgot the change the expected output file. 2001-08-24 04:33:10 +00:00
Tim Peters a365309528 Add a test for the new // operator too. 2001-08-23 23:02:57 +00:00
Tim Peters 26c7fa355a SF bug [#454456] int overflow code needs tests.
Added tests for boundary cases in magical PEP 237 int->long auto-overflow,
but nothing here addresses the rest of the bug report so left it open.
2001-08-23 22:56:21 +00:00
Greg Ward f17efb93d9 Patch #449054 to implement PEP 250. The standard install directory for
modules and extensions on Windows is now $PREFIX/Lib/site-packages.
Includes backwards compatibility code for pre-2.2 Pythons.  Contributed
by Paul Moore.
2001-08-23 20:53:27 +00:00
Tim Peters 971e0690c4 Remove test_long's expected-output file. 2001-08-23 20:34:01 +00:00
Fredrik Lundh c266bb0594 untabification 2001-08-23 20:13:08 +00:00
Fredrik Lundh 78eedce3ff updated to current PythonWare version (1.0b3). fixed type checks in
DateTime constructor.  use ServerProxy instead of Server in sample
code.
2001-08-23 20:04:33 +00:00
Finn Bock 84cc9bf722 Committing and closing SF patch #441348 to help Jython to pass this test. 2001-08-23 18:57:01 +00:00
Guido van Rossum 88e0b5bee0 SF patch #454553 by Walter Dörwald: auto-guess content-type header for
ftp urls.
2001-08-23 13:38:15 +00:00
Jack Jansen be92af0e2a Don't make even the _slightest_ modification between test and checkin,
or you will break something:-)
2001-08-23 13:25:59 +00:00
Jack Jansen 0eb936b47d The MacOS module may be available on Mac OS X, but it doesn't have a SchedParams() method, and there's no need to call it anyway. 2001-08-23 13:18:10 +00:00
Guido van Rossum 83b120d690 Turn OverflowWarning into an error locally, in order to make the
OverflowError test succeed.
2001-08-23 03:23:03 +00:00
Guido van Rossum acc21d8814 Ignore OverflowWarning by default. To enable the warning, use
python -Wdefault

or

	python -Wdefault::OverflowWarning
2001-08-23 03:07:42 +00:00
Barry Warsaw 60f018846d Merge changes from r22a2-branch back into trunk. Also, change patch
level to 2.2a2+
2001-08-22 19:24:42 +00:00
Ka-Ping Yee 83205972a2 Enhancements:
- file URL now starts with "file://" (standard) rather than "file:"
- new optional argument 'context' to enable()
- repeated variable names don't have their values shown twice
- dotted attributes are shown; missing attributes handled reasonably
- highlight the whole logical line even if it has multiple physical lines
- use nice generator interface to tokenize
- formatting fixed so that it looks good in lynx, links, and w3m too
2001-08-21 06:53:01 +00:00
Barry Warsaw d1ed15edb3 A test of SSL support, using a roundabout method suggested by Guido.
However, this is only enabled with regrtest's --use=network switch.
2001-08-20 22:39:42 +00:00
Barry Warsaw 7fdfc3885c Use test_support.requires() to decide whether additional largefile
tests should be run.
2001-08-20 22:37:34 +00:00
Barry Warsaw 08fca52125 Removed --have-resources flag in favor of the more granular -u/--use
flag, which specifies external or resource intensive tests to
perform.  This is used by test_largefile and test_socket_ssl.

-u/--use takes a comma separated list of flags, currently supported:
largefile, network.

usage(): New function.  Note that the semantics of main() have changed
    slightly; instead of returning an error code, it raises a
    SystemExit (via sys.exit()) with the given error code.

main(): use_large_resources => use_resources
    Also, added support for long-option alternative to the short
    options.

_expectations: Added test_socket_ssl to the list of expectedly skipped
    tests.
2001-08-20 22:33:46 +00:00
Barry Warsaw c0fb605ce3 use_large_resources => use_resources
requires(): New function which can be used to `assert' that a specific
    -u/--use resource flag is present.  Raises a TestSkipped if not.
    This is used in test_largefile and test_socket_ssl to enable
    external or resource consumptive tests that are normally
    disabled.
2001-08-20 22:29:23 +00:00
Tim Peters 7c005af915 Whitespace normalization. 2001-08-20 21:48:00 +00:00
Tim Peters 02035bc68d Test failed because these was no expected-output file, but always printed
to stdout.  Repaired by not printing at all except in verbose mode.

Made the test about 6x faster -- envelope analysis showed it took time
proportional to the square of the # of tasks.  Now it's linear.
2001-08-20 21:45:19 +00:00
Fred Drake 029acfb922 Deal more appropriately with bare ampersands and pointy brackets; this
module has to deal with "class" HTML-as-deployed as well as XHTML, so we
cannot be as strict as XHTML allows.

This closes SF bug #453059, but uses a different fix than suggested in
the bug comments.
2001-08-20 21:24:19 +00:00
Jeremy Hylton 18da1e1e7f Add test case to cover multiple future statements on separate lines of
a module.
2001-08-20 21:18:56 +00:00
Jeremy Hylton 8471a35feb Fix SF bug [ #450245 ] Error in parsing future stmts
Add test case to cover multiple future statements on separate lines of
a module.
2001-08-20 20:33:42 +00:00