/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/_static_tuple_c.c

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 18:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521181028-zn04pdfw0od9hfj3
Rename brzlib => breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
/* Pyrex 0.9.6.4 exports _simple_set_pyx_api as
30
30
 * import__simple_set_pyx(), while Pyrex 0.9.8.5 and Cython 0.11.3 export them
31
 
 * as import_brzlib___simple_set_pyx(). As such, we just #define one to be
 
31
 * as import_breezy___simple_set_pyx(). As such, we just #define one to be
32
32
 * equivalent to the other in our internal code.
33
33
 */
34
 
#define import__simple_set_pyx import_brzlib___simple_set_pyx
 
34
#define import__simple_set_pyx import_breezy___simple_set_pyx
35
35
#include "_simple_set_pyx_api.h"
36
36
 
37
37
#if defined(__GNUC__)
782
782
PyTypeObject StaticTuple_Type = {
783
783
    PyObject_HEAD_INIT(NULL)
784
784
    0,                                           /* ob_size */
785
 
    "brzlib._static_tuple_c.StaticTuple",        /* tp_name */
 
785
    "breezy._static_tuple_c.StaticTuple",        /* tp_name */
786
786
    sizeof(StaticTuple),                         /* tp_basicsize */
787
787
    sizeof(PyObject *),                          /* tp_itemsize */
788
788
    (destructor)StaticTuple_dealloc,             /* tp_dealloc */
894
894
     * versus how pyrex 0.9.8 and cython 0.11 export it.
895
895
     * Namely 0.9.6 exports import__simple_set_pyx and tries to
896
896
     * "import _simple_set_pyx" but it is available only as
897
 
     * "import brzlib._simple_set_pyx"
 
897
     * "import breezy._simple_set_pyx"
898
898
     * It is a shame to hack up sys.modules, but that is what we've got to do.
899
899
     */
900
900
    PyObject *sys_module = NULL, *modules = NULL, *set_module = NULL;
903
903
    /* Clear out the current ImportError exception, and try again. */
904
904
    PyErr_Clear();
905
905
    /* Note that this only seems to work if somewhere else imports
906
 
     * brzlib._simple_set_pyx before importing brzlib._static_tuple_c
 
906
     * breezy._simple_set_pyx before importing breezy._static_tuple_c
907
907
     */
908
 
    set_module = PyImport_ImportModule("brzlib._simple_set_pyx");
 
908
    set_module = PyImport_ImportModule("breezy._simple_set_pyx");
909
909
    if (set_module == NULL) {
910
910
        goto end;
911
911
    }
920
920
    }
921
921
    PyDict_SetItemString(modules, "_simple_set_pyx", set_module);
922
922
    /* Now that we have hacked it in, try the import again. */
923
 
    retval = import_brzlib___simple_set_pyx();
 
923
    retval = import_breezy___simple_set_pyx();
924
924
end:
925
925
    Py_XDECREF(set_module);
926
926
    Py_XDECREF(sys_module);
945
945
 
946
946
    Py_INCREF(&StaticTuple_Type);
947
947
    PyModule_AddObject(m, "StaticTuple", (PyObject *)&StaticTuple_Type);
948
 
    if (import_brzlib___simple_set_pyx() == -1
 
948
    if (import_breezy___simple_set_pyx() == -1
949
949
        && _workaround_pyrex_096() == -1)
950
950
    {
951
951
        return;