summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2016-01-11 20:53:19 (GMT)
committerBarry Warsaw <barry@python.org>2016-01-11 20:53:19 (GMT)
commite9736204720b7a3d1a4c17d7c69958f464c9b69a (patch)
treefc88821ac18194852598fd303aff32f20cc8587f
parentb2b12172706df5e4686a5fccdcf88ebe22ee5b5f (diff)
parent09880c89e9736efe590243876d777e52b1d6abf2 (diff)
downloadcpython-e9736204720b7a3d1a4c17d7c69958f464c9b69a.zip
cpython-e9736204720b7a3d1a4c17d7c69958f464c9b69a.tar.gz
cpython-e9736204720b7a3d1a4c17d7c69958f464c9b69a.tar.bz2
Merge heads.
-rw-r--r--Lib/test/test_csv.py21
-rw-r--r--Objects/typeobject.c27
2 files changed, 11 insertions, 37 deletions
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index a90c7b2..77c315e 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -426,16 +426,17 @@ class TestDialectRegistry(unittest.TestCase):
self.assertRaises(TypeError, csv.reader, [], quoting = -1)
self.assertRaises(TypeError, csv.reader, [], quoting = 100)
- def test_copy(self):
- for name in csv.list_dialects():
- dialect = csv.get_dialect(name)
- self.assertRaises(TypeError, copy.copy, dialect)
-
- def test_pickle(self):
- for name in csv.list_dialects():
- dialect = csv.get_dialect(name)
- for proto in range(pickle.HIGHEST_PROTOCOL + 1):
- self.assertRaises(TypeError, pickle.dumps, dialect, proto)
+ # See issue #22995
+ ## def test_copy(self):
+ ## for name in csv.list_dialects():
+ ## dialect = csv.get_dialect(name)
+ ## self.assertRaises(TypeError, copy.copy, dialect)
+
+ ## def test_pickle(self):
+ ## for name in csv.list_dialects():
+ ## dialect = csv.get_dialect(name)
+ ## for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ ## self.assertRaises(TypeError, pickle.dumps, dialect, proto)
class TestCsvBase(unittest.TestCase):
def readerAssertEqual(self, input, expected_result):
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index ff4ae11..415f916 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3866,33 +3866,6 @@ _PyObject_GetState(PyObject *obj, int required)
}
assert(slotnames == Py_None || PyList_Check(slotnames));
-#if 0
- /* 2016-01-11 barry - This clause breaks at least three packages which
- rely on Cython: kivy, pysam, and s3ql. Cython may be doing
- something funny under the hood, but as this is clearly a regression
- and the rationale for this prohibition is suspect, I am commenting
- this out. Perhaps it should just be removed. See issue #22995 for
- details.
- */
- if (required) {
- Py_ssize_t basicsize = PyBaseObject_Type.tp_basicsize;
- if (obj->ob_type->tp_dictoffset)
- basicsize += sizeof(PyObject *);
- if (obj->ob_type->tp_weaklistoffset)
- basicsize += sizeof(PyObject *);
- if (slotnames != Py_None)
- basicsize += sizeof(PyObject *) * Py_SIZE(slotnames);
- if (obj->ob_type->tp_basicsize > basicsize) {
- Py_DECREF(slotnames);
- Py_DECREF(state);
- PyErr_Format(PyExc_TypeError,
- "can't pickle %.200s objects",
- Py_TYPE(obj)->tp_name);
- return NULL;
- }
- }
-#endif
-
if (slotnames != Py_None && Py_SIZE(slotnames) > 0) {
PyObject *slots;
Py_ssize_t slotnames_size, i;