Ticket #13896: cython-0.17.3.p0.diff

File cython-0.17.3.p0.diff, 2.3 KB (added by jpflori, 8 years ago)
  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    3131
    3232== Changelog ==
    3333
     34=== cython-0.17.3.p0 (Jean-Pierre Flori, 2 January 2012) ===
     35 * #13896: Fix Cython Track/UnTrack for garbage collection.
     36
    3437=== cython-0.17.3 (Volker Braun, 14 December 2012) ===
    3538 * Upgrade Cython 0.17.3
    3639
  • new file patches/gc_track.patch

    diff --git a/patches/gc_track.patch b/patches/gc_track.patch
    new file mode 100644
    - +  
     1diff -dru src.orig/Cython/Compiler/ModuleNode.py src/Cython/Compiler/ModuleNode.py
     2--- src.orig/Cython/Compiler/ModuleNode.py      2012-12-14 09:53:21.000000000 +0100
     3+++ src/Cython/Compiler/ModuleNode.py   2013-01-02 19:40:18.328274389 +0100
     4@@ -1130,6 +1130,9 @@
     5 
     6         # call the user's __dealloc__
     7         self.generate_usr_dealloc_call(scope, code)
     8+
     9+        code.putln("if (PyObject_IS_GC(o)) PyObject_GC_UnTrack(o);")
     10+
     11         if weakref_slot in scope.var_entries:
     12             code.putln("if (p->__weakref__) PyObject_ClearWeakRefs(o);")
     13 
     14@@ -1152,6 +1156,7 @@
     15                                              have_gil=True)
     16 
     17         if base_type:
     18+            code.putln("if (PyObject_IS_GC(o)) PyObject_GC_Track(o);")
     19             tp_dealloc = TypeSlots.get_base_slot_function(scope, tp_slot)
     20             if tp_dealloc is not None:
     21                 code.putln("%s(o);" % tp_dealloc)
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    11#!/usr/bin/env bash
    22
    3 if [ "$SAGE_LOCAL" = "" ]; then
    4     echo "SAGE_LOCAL undefined ... exiting"
    5     echo "Maybe run 'sage -sh'?"
     3if [ -z "$SAGE_LOCAL" ]; then
     4    echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
     5    echo >&2 "Maybe run 'sage -sh'?"
    66    exit 1
    77fi
    88
     9cd src/
     10
     11# Apply patches (if any):
     12
     13echo "Applying patches to upstream sources..."
     14for patch in ../patches/*.patch; do
     15    patch -p1 <"$patch"
     16    if [ $? -ne 0 ]; then
     17        echo >&2 "Error: '$patch' failed to apply."
     18        exit 1
     19    fi
     20done
     21
    922# remove old copies
    1023
    1124rm -rf "$SAGE_LOCAL"/lib/python2.*/site-packages/Cython*
    1225rm -rf "$SAGE_LOCAL"/lib/python/site-packages/Cython*
    1326
    14 cd src/
     27# installing new version
    1528
    1629python setup.py install
    1730
    1831if [ $? -ne 0 ]; then
    19     echo "Error installing Cython"
     32    echo >&2 "Error installing Cython"
    2033    exit 1
    2134fi