[pypy-svn] r11009 - in pypy/dist: lib-python-2.3.4/test pypy/lib pypy/lib/test2
hpk at codespeak.net
hpk at codespeak.net
Fri Apr 22 00:30:37 CEST 2005
Author: hpk
Date: Fri Apr 22 00:30:37 2005
New Revision: 11009
Modified:
pypy/dist/lib-python-2.3.4/test/conftest.py
pypy/dist/pypy/lib/itertools.py
pypy/dist/pypy/lib/test2/conftest.py
Log:
- fix itertools's islice(). Somehow i am wondering
why nobody fixed this before or am i missing something?
- get rid of the "get pypy/lib out of sys.path" hack
(we'll see how far that works)
- enabled modified version of test_itertools in
lib-python-2.3.4
Modified: pypy/dist/lib-python-2.3.4/test/conftest.py
==============================================================================
--- pypy/dist/lib-python-2.3.4/test/conftest.py (original)
+++ pypy/dist/lib-python-2.3.4/test/conftest.py Fri Apr 22 00:30:37 2005
@@ -423,8 +423,8 @@
'test_iter.py' : TestDecl(False, UTModuleMainTest),
#rev 10840: Uncaught interp-level exception: Same place as test_cfgparser
- 'test_itertools.py' : TestDecl(False, UTModuleMainTest),
- #rev 10840: Alternate version in test2
+ 'test_itertools.py' : TestDecl(True, UTModuleMainTest, modified=True),
+ # modified version in pypy/lib/test2
'test_largefile.py' : TestDecl(False, UnknownTestModule),
'test_linuxaudiodev.py' : TestDecl(False, OutputTestModule),
Modified: pypy/dist/pypy/lib/itertools.py
==============================================================================
--- pypy/dist/pypy/lib/itertools.py (original)
+++ pypy/dist/pypy/lib/itertools.py Fri Apr 22 00:30:37 2005
@@ -355,6 +355,10 @@
def __init__(self, iterable, *args):
s = slice(*args)
self.start, self.stop, self.step = s.start or 0, s.stop, s.step
+ if not isinstance(self.start, (int, long)):
+ raise ValueError("Start argument must be an integer")
+ if self.stop is not None and not isinstance(self.stop, (int,long)):
+ raise ValueError("Stop argument must be an integer or None")
if self.step is None:
self.step = 1
if self.start<0 or (self.stop is not None and self.stop<0
Modified: pypy/dist/pypy/lib/test2/conftest.py
==============================================================================
--- pypy/dist/pypy/lib/test2/conftest.py (original)
+++ pypy/dist/pypy/lib/test2/conftest.py Fri Apr 22 00:30:37 2005
@@ -23,11 +23,11 @@
pypydir = py.path.local(pypy.__file__).dirpath()
# hack out pypy/lib -> XXX we need to restructure our test2 situation
-pypylibdir = pypydir.join('lib')
-if str(pypylibdir) in sys.path:
- print "warning, %s on sys.path at cpython level, removing it" % pypylibdir
- sys.path.remove(str(pypylibdir))
-assert str(pypylibdir) not in sys.path
+#pypylibdir = pypydir.join('lib')
+#if str(pypylibdir) in sys.path:
+# print "warning, %s on sys.path at cpython level, removing it" % pypylibdir
+# sys.path.remove(str(pypylibdir))
+#assert str(pypylibdir) not in sys.path
libtestdir = pypydir.dirpath('lib-python-2.3.4', 'test')
libconftest = libtestdir.join('conftest.py').getpymodule() # read())
More information about the Pypy-commit
mailing list