Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Include/py_curses.h

    r2 r391  
    8181#define PyCursesWindow_Check(v)  (Py_TYPE(v) == &PyCursesWindow_Type)
    8282
     83#define PyCurses_CAPSULE_NAME "_curses._C_API"
     84
     85
    8386#ifdef CURSES_MODULE
    8487/* This section is used when compiling _cursesmodule.c */
     
    9598
    9699#define import_curses() \
    97 { \
    98   PyObject *module = PyImport_ImportModuleNoBlock("_curses"); \
    99   if (module != NULL) { \
    100     PyObject *module_dict = PyModule_GetDict(module); \
    101     PyObject *c_api_object = PyDict_GetItemString(module_dict, "_C_API"); \
    102     if (PyCObject_Check(c_api_object)) { \
    103       PyCurses_API = (void **)PyCObject_AsVoidPtr(c_api_object); \
    104     } \
    105   } \
    106 }
     100    PyCurses_API = (void **)PyCapsule_Import(PyCurses_CAPSULE_NAME, 1);
     101
    107102#endif
    108103
Note: See TracChangeset for help on using the changeset viewer.