[Python-checkins] r64532 - in python/branches/tlee-ast-optimize: Lib/test/test_cpickle.py Mac/Makefile.in Modules/cPickle.c
thomas.lee
python-checkins at python.org
Thu Jun 26 16:32:11 CEST 2008
Author: thomas.lee
Date: Thu Jun 26 16:32:10 2008
New Revision: 64532
Log:
Merged revisions 64525-64531 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r64526 | mark.dickinson | 2008-06-26 01:29:32 +1000 (Thu, 26 Jun 2008) | 2 lines
issue #3199: Fix typo in Mac/Makefile.in
........
r64527 | facundo.batista | 2008-06-26 05:24:53 +1000 (Thu, 26 Jun 2008) | 9 lines
Reverting the patch from #3165, as it broke other
behaviours. I left the original test commented out (note
that that test came from #2702, which seems to have a
problem in FreeBSD and Windows, but not in Linux).
I included a new test, to watch over the now-broken
behaviour, I took it from #3179.
........
Modified:
python/branches/tlee-ast-optimize/ (props changed)
python/branches/tlee-ast-optimize/Lib/test/test_cpickle.py
python/branches/tlee-ast-optimize/Mac/Makefile.in
python/branches/tlee-ast-optimize/Modules/cPickle.c
Modified: python/branches/tlee-ast-optimize/Lib/test/test_cpickle.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_cpickle.py (original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_cpickle.py Thu Jun 26 16:32:10 2008
@@ -94,16 +94,28 @@
pass
class cPickleDeepRecursive(unittest.TestCase):
- '''Issue 2702. This should raise a RecursionLimit but in some
- platforms (FreeBSD, win32) sometimes raises KeyError instead,
- or just silently terminates the interpreter (=crashes).
- '''
- def test_deep_recursive(self):
- nodes = [Node() for i in range(500)]
- for n in nodes:
- n.connections = list(nodes)
- n.connections.remove(n)
- self.assertRaises(RuntimeError, cPickle.dumps, n)
+# I commented out, because the patch that fixes this was reverted, as
+# it broke the next test case. Check the issues for full history.
+# def test_issue2702(self):
+# '''This should raise a RecursionLimit but in some
+# platforms (FreeBSD, win32) sometimes raises KeyError instead,
+# or just silently terminates the interpreter (=crashes).
+# '''
+# nodes = [Node() for i in range(500)]
+# for n in nodes:
+# n.connections = list(nodes)
+# n.connections.remove(n)
+# self.assertRaises(RuntimeError, cPickle.dumps, n)
+
+ def test_issue3179(self):
+ '''Safe test, because of I broken this case when fixing the
+ behaviour for the previous test.
+ '''
+ res=[]
+ for x in range(1,2000):
+ res.append(dict(doc=x, similar=[]))
+ cPickle.dumps(res)
+
def test_main():
test_support.run_unittest(
Modified: python/branches/tlee-ast-optimize/Mac/Makefile.in
==============================================================================
--- python/branches/tlee-ast-optimize/Mac/Makefile.in (original)
+++ python/branches/tlee-ast-optimize/Mac/Makefile.in Thu Jun 26 16:32:10 2008
@@ -113,7 +113,7 @@
$(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
fi
for fn in python$(VERSION) pythonw$(VERSION) idle$(VERSION) \
- pydoc$(VERSION) python$(VERSION)-config) smtpd$(VERSION).py ;\
+ pydoc$(VERSION) python$(VERSION)-config smtpd$(VERSION).py ;\
do \
ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
done
Modified: python/branches/tlee-ast-optimize/Modules/cPickle.c
==============================================================================
--- python/branches/tlee-ast-optimize/Modules/cPickle.c (original)
+++ python/branches/tlee-ast-optimize/Modules/cPickle.c Thu Jun 26 16:32:10 2008
@@ -1523,8 +1523,6 @@
static char append = APPEND;
static char appends = APPENDS;
- self->nesting++;
-
assert(iter != NULL);
if (self->proto == 0) {
@@ -1664,8 +1662,6 @@
static char setitem = SETITEM;
static char setitems = SETITEMS;
- self->nesting++;
-
assert(iter != NULL);
if (self->proto == 0) {
More information about the Python-checkins
mailing list