~barcc/ubuntu/saucy/pyicu/lp1200419

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /bin/sh /usr/share/dpatch/dpatch-run
## ICUtzinfo-not-heap-type.dpatch by Jakub Wilk <jwilk@debian.org>
##
## DP: Revert upstream change to make ICUtzinfo a heap type.
## DP: See https://bugzilla.osafoundation.org/show_bug.cgi?id=13038

diff --git a/tzinfo.cpp b/tzinfo.cpp
--- a/tzinfo.cpp
+++ b/tzinfo.cpp
@@ -122,7 +122,6 @@
     0,                                  /* tp_setattro */
     0,                                  /* tp_as_buffer */
     (Py_TPFLAGS_DEFAULT |
-     Py_TPFLAGS_HEAPTYPE |
      Py_TPFLAGS_BASETYPE),              /* tp_flags */
     "",                                 /* tp_doc */
     0,                                  /* tp_traverse */
@@ -445,7 +444,7 @@
 
             Py_XDECREF((PyObject *) _default);
             _default = (t_tzinfo *) tzinfo;
-            PyObject_SetAttrString((PyObject *)&TZInfoType, "default", tzinfo);
+            PyDict_SetItemString(TZInfoType.tp_dict, "default", tzinfo);
 
             Py_RETURN_NONE;
         }