| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
please let me know and we'll figure out how to fix the test.)
|
|
|
|
| |
docstrings (using file.closed and file.name as examples).
|
| |
|
|
|
|
|
| |
allows using the tests with unittest.py as a script. The tests will
still run when run as a script themselves.
|
|
|
|
|
|
|
|
|
|
| |
elements which are not Unicode objects or strings. (This matches
the string.join() behaviour.)
Fix a memory leak in the .join() method which occurs in case
the Unicode resize fails.
Restore the test_unicode output.
|
| |
|
| |
|
|
|
|
|
| |
works just like str(obj) in that it tries __str__/tp_str on the object
in case it finds that the object is not a string or buffer.
|
| |
|
|
|
|
|
| |
codecs -- the self argument does matter for Python functions (it
does not for C functions which most other codecs use).
|
| |
|
|
|
|
|
|
|
|
| |
their own test suite from a multitude of classes (like test_email.py
will be doing).
run_unittest(): Call run_suite() after making a suite from the
testclass.
|
|
|
|
|
|
|
|
| |
inspect.getargspec(obj), test isfunction() directly in pydoc.py instead
of trying to indirectly deduce isfunction() in pydoc by virtue of
failing a combination of other tests. This shouldn't have any visible
effect, except perhaps to squash a TypeError death if there was some path
thru this code that was inferring isfunction() by mistake.
|
|
|
|
|
| |
both return true. This restores pydoc's ability to deduce argument lists
for functions and methods coded in Python.
|
|
|
|
|
| |
pydoc how to do something sensible with 2.2 descriptors. To see the
difference, browse __builtin__ via pydoc before and after the patch.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
__init__.py module to raise errors which can be catched as LookupErrors
as well as SystemErrors.
Modified the error messages to include more information about the
failing module.
|
| |
|
| |
|
|
|
|
| |
float (compare the recent checkin to complex). Added tests for these.
|
|
|
|
|
|
|
|
|
| |
instance.
Split a string comparison test in two halves, replacing "a==b==a" with
separate tests for a==b and b==a. (Reason: while experimenting, this
test failed, and I wanted to know if it was the first or the second ==
operator that failed.)
|
|
|
|
| |
with subsclasses of complex and string.
|
| |
|
|
|
|
|
|
| |
\g<x> group reference followed by a character escape
(also restructured a few things on the way to fixing #449000)
|
|
|
|
|
|
|
|
| |
hack, and it's even more disgusting than a PyInstance_Check() call.
If the tp_compare slot is the slot used for overrides in Python,
it's always called.
Add some tests that show what should work too.
|
|
|
|
| |
skipped test -- the print command already supplies a space.
|
| |
|
| |
|
|
|
|
|
|
|
| |
#462270: sub-tle difference between pre.sub and sre.sub. PRE ignored
an empty match at the previous location, SRE didn't.
also synced with Secret Labs "sreopen" codebase.
|
|
|
|
|
|
|
|
|
| |
boundary.
Fixed by keeping a readahead buffer containing the next line.
XXX We have no test suite for this. Maybe the new email package will
help?
|
|
|
|
| |
upon attempted attribute assignment. Caught by MWH, SF bug #462522.
|
|
|
|
|
|
|
| |
on file.__methods__. Since the docs say "This module will become obsolete
in a future release", this is just a quick hack to stop it from blowing
up. If you care about this module, test it! It doesn't make much sense
on Windows.
|
|
|
|
| |
(AttributeError, TypeError) -- the leniency wasn't needed everywhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to raise TypeError. In practice, a disallowed attribute assignment
can raise either TypeError or AttributeError (and it's unclear which
is better). So allow either. (Yes, this is in anticipation of a
code change that switches the exception raised. :-)
- Add a utility function, cantset(), which verifies that setting a
particular attribute to a given value is disallowed, and also that
deleting that same attribute is disallowed. Use this in the
test_func_*() tests.
- Add a new set of tests that test conformance of various instance
method attributes. (Also in anticipation of code that changes their
implementation.)
|
| |
|
|
|
|
| |
Add it back to the list of tests we expect to skip on Windows.
|
| |
|
|
|
|
|
| |
Also raise TestSkipped (intead of appearing to fail) if the import lock
is held.
|
|
|
|
|
| |
This uses the new "restricted" feature of structmember, and getset
descriptors for some of the type checks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compile() becomes replacement for builtin compile()
compileFile() generates a .pyc from a .py
both are exported in __init__
compiler.parse() gets optional second argument to specify compilation
mode, e.g. single, eval, exec
Add AbstractCompileMode as parent class and Module, Expression, and
Interactive as concrete subclasses. Each corresponds to a compilation
mode.
THe AbstractCompileMode instances in turn delegate to CodeGeneration
subclasses specialized for their particular functions --
ModuleCodeGenerator, ExpressionCodeGeneration,
InteractiveCodeGenerator.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the only test in the syntax module. It ends up that the
transformer must handle this error case.
In the transformer, check for a list compression in com_assign_list()
by looking for a list_for node where a comma is expected.
In pycodegen.compile() re-raise the SyntaxError rather than catching
it and exiting
|
|
|
|
|
|
|
|
| |
Invoke compiler.syntax.check() after building AST. If a SyntaxError
occurs, print the error and exit without generating a .pyc file.
Refactor code to use compiler.misc.set_filename() rather than passing
filename argument around to each CodeGenerator instance.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Once upon a time, I put together a little function
that tries to find the canonical filename for a given
pathname on POSIX. I've finally gotten around to
turning it into a proper patch with documentation.
On non-POSIX, I made it an alias for 'abspath', as
that's the behavior on POSIX when no symlinks are
encountered in the path.
Example:
>>> os.path.realpath('/usr/bin/X11/X')
'/usr/X11R6/bin/X'
|