Commit Graph

21 Commits

Author SHA1 Message Date
Guido van Rossum be19ed77dd Fix most trivially-findable print statements.
There's one major and one minor category still unfixed:
doctests are the major category (and I hope to be able to augment the
refactoring tool to refactor bona fide doctests soon);
other code generating print statements in strings is the minor category.

(Oh, and I don't know if the compiler package works.)
2007-02-09 05:37:30 +00:00
Guido van Rossum b940e113bf SF patch 1631942 by Collin Winter:
(a) "except E, V" -> "except E as V"
(b) V is now limited to a simple name (local variable)
(c) V is now deleted at the end of the except block
2007-01-10 16:19:56 +00:00
Jack Diederich 4dafcc4ece - patch #1600346 submitted by Tomer Filiba
- Renamed nb_nonzero slots to nb_bool
- Renamed __nonzero__ methods to __bool__
- update core, lib, docs, and tests to match
2006-11-28 19:15:13 +00:00
Alex Martelli 01c77c6628 Anna Ravenscroft identified many occurrences of "file" used to open a file
in the stdlib and changed each of them to use "open" instead.  At this
time there are no other known occurrences that can be safely changed (in
Lib and all subdirectories thereof).
2006-08-24 02:58:11 +00:00
Guido van Rossum e2b70bcf74 Get rid of dict.has_key(). Boy this has a lot of repercussions!
Not all code has been fixed yet; this is just a checkpoint...
The C API still has PyDict_HasKey() and _HasKeyString(); not sure
if I want to change those just yet.
2006-08-18 22:13:04 +00:00
Guido van Rossum bf12cdbb28 Quite a few fixes to make the library and test suite more robust when
cPickle cannot be imported.  This was necessary because my last mass
checkin broke cPickle and I don't feel like debugging it right now;
but it seems a good idea in general not to require cPickle when
pickle.py is also there.  A few unrelated fixes for issues while
debigging various test failures.

setup.py: disable building of cPickle until I've fixed it

Objects/...

  genobject.c: disallow raising string exceptions

Lib/...

  Cookie.py: fix doctest not to fail if cPickle is missing
  ctypes/macholib/dyld.py: fix relative imports
  sqlite3/__init__.py: fix relative import
  xml/dom/__init__.py: fix relative import

Lib/test/...

  regrtest.py: reduce list of skipped items on darwin

  test_generators.py: don't test string exceptions; test throw() errors
  test_traceback.py: don't test string exceptions

  pickletester.py: don't fail if cPickle is missing
  test_datetime.py: don't fail if cPickle is missing
  test_descr.py: don't fail if cPickle is missing (still some other failures)
  test_exceptions.py: don't fail if cPickle is missing
  test_re.py: don't fail if cPickle is missing

  test_array.py: use pickle, not cPickle
  test_bool.py: don't fail if cPickle is missing
  test_deque.py: use pickle, not cPickle
  test_logging.py: use pickle, not cPickle
2006-08-17 20:24:18 +00:00
Tim Peters 478c10554b Whitespace normalization. 2003-06-29 05:46:54 +00:00
Jeremy Hylton 7ff55e6bc5 Add tests for __nonzero__() problems. 2003-06-27 17:40:16 +00:00
Tim Peters c2659cff5d Whitespace normalization. 2003-05-12 20:19:37 +00:00
Walter Dörwald 21d3a32b99 Combine the functionality of test_support.run_unittest()
and test_support.run_classtests() into run_unittest()
and use it wherever possible.

Also don't use "from test.test_support import ...", but
"from test import test_support" in a few spots.

From SF patch #662807.
2003-05-01 17:45:56 +00:00
Walter Dörwald 90437c03f2 Consistently use test_support.foo everywhere.
Remove the last use of veris().

Remove now useless imports and functions.
2003-05-01 13:12:34 +00:00
Raymond Hettinger 9dcbbea878 Factor out common boilerplate for test_support 2003-04-27 07:54:23 +00:00
Walter Dörwald dbcede5d66 Port test_bool.py to PyUnit. From SF patch #662807. 2003-04-25 10:22:01 +00:00
Guido van Rossum aa86e35c52 - bool() called without arguments now returns False rather than
raising an exception.  This is consistent with calling the
  constructors for the other builtin types -- called without argument
  they all return the false value of that type.  (SF patch #724135)
  Thanks to Alex Martelli.
2003-04-19 18:15:10 +00:00
Barry Warsaw 04f357cffe Get rid of relative imports in all unittests. Now anything that
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".

This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).

Now Tim and Jack can have at it. :)
2002-07-23 19:04:11 +00:00
Michael W. Hudson 5efaf7eac8 This is my nearly two year old patch
[ 400998 ] experimental support for extended slicing on lists

somewhat spruced up and better tested than it was when I wrote it.

Includes docs & tests.  The whatsnew section needs expanding, and arrays
should support extended slices -- later.
2002-06-11 10:55:12 +00:00
Michael W. Hudson 7c6a4ad78f More mindless --disable-unicode proofing. 2002-05-20 14:22:28 +00:00
Martin v. Löwis 2f6d4da278 Patch #542569: tp_print tp_repr tp_str in test_bool.py. 2002-04-14 10:22:29 +00:00
Guido van Rossum d1bfe5e5fd Add tests for binary pickles. 2002-04-05 20:57:02 +00:00
Guido van Rossum e276339cea Implement an idea by Paul Rubin:
Change pickling format for bools to use a backwards compatible
encoding.  This means you can pickle True or False on Python 2.3
and Python 2.2 or before will read it back as 1 or 0.  The code
used for pickling bools before would create pickles that could
not be read in previous Python versions.
2002-04-05 19:30:08 +00:00
Guido van Rossum 5f8203679d Oops. Here are the new files. My apologies. 2002-04-03 23:01:45 +00:00