~corey.bryant/ubuntu/wily/python-pyscss/thedac

« back to all changes in this revision

Viewing changes to debian/patches/python3-fixup.patch

  • Committer: Package Import Robot
  • Author(s): Thomas Goirand
  • Date: 2014-06-26 12:10:36 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140626121036-3dv13zn5zptk9fpx
Tags: 1.2.0.post3-1
* Team upload.
* New upstream release (Closes: #738776).
* Added a debian/gbp.conf.
* Added missing ${python:Depends}
* Added Python 3 support.
* Removed duplicate debhelper build-depends.
* Cannonical VCS URLs.
* Standards-Version: is now 3.9.5.
* Added a watch file.
* override dh helpers which the package doesn't use.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Fixes _speedup.c for Python 3
 
2
Author: Thomas Goirand <zigo@debian.org>
 
3
Forwarded: no
 
4
Last-Update: 2014-06-27
 
5
 
 
6
--- python-pyscss-1.2.0.post3.orig/scss/src/_speedups.c
 
7
+++ python-pyscss-1.2.0.post3/scss/src/_speedups.c
 
8
@@ -12,8 +12,16 @@
 
9
 #include "block_locator.h"
 
10
 #include "scanner.h"
 
11
 
 
12
+#ifndef Py_TYPE
 
13
+  #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
 
14
+#endif
 
15
+
 
16
+#if PY_MAJOR_VERSION >=3
 
17
+#  define Py_TPFLAGS_HAVE_ITER 0
 
18
+#endif
 
19
+
 
20
 /* BlockLocator */
 
21
-staticforward PyTypeObject scss_BlockLocatorType;
 
22
+static PyTypeObject scss_BlockLocatorType;
 
23
 
 
24
 typedef struct {
 
25
        PyObject_HEAD
 
26
@@ -46,7 +54,7 @@ scss_BlockLocator_dealloc(scss_BlockLoca
 
27
 {
 
28
        if (self->locator != NULL) BlockLocator_del(self->locator);
 
29
 
 
30
-       self->ob_type->tp_free((PyObject*)self);
 
31
+       Py_TYPE(self)->tp_free((PyObject*)self);
 
32
 
 
33
        #ifdef DEBUG
 
34
                PySys_WriteStderr("Scss BlockLocator object destroyed!\n");
 
35
@@ -136,7 +144,7 @@ static PyTypeObject scss_BlockLocatorTyp
 
36
 /* Scanner */
 
37
 static PyObject *PyExc_scss_NoMoreTokens;
 
38
 
 
39
-staticforward PyTypeObject scss_ScannerType;
 
40
+static PyTypeObject scss_ScannerType;
 
41
 
 
42
 typedef struct {
 
43
        PyObject_HEAD
 
44
@@ -442,7 +450,7 @@ scss_Scanner_dealloc(scss_Scanner *self)
 
45
 {
 
46
        if (self->scanner != NULL) Scanner_del(self->scanner);
 
47
 
 
48
-       self->ob_type->tp_free((PyObject*)self);
 
49
+       Py_TYPE(self)->tp_free((PyObject*)self);
 
50
 
 
51
        #ifdef DEBUG
 
52
                PySys_WriteStderr("Scss Scanner object destroyed!\n");