Changeset d5aeaa3 in sasview


Ignore:
Timestamp:
Sep 26, 2017 12:36:53 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
0225a3f
Parents:
f542866
Message:

add CLoader to the correct module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/file_converter/c_ext/bsl_loader.c

    rd04ac05 rd5aeaa3  
    279279}; 
    280280 
    281 static PyMethodDef module_methods[] = { 
    282     {NULL} 
    283 }; 
    284  
    285281/** 
    286282 * Function used to add the model class to a module 
    287283 * @param module: module to add the class to 
    288284 */ 
    289 void addCLoader(PyObject *module) { 
     285void addCLoader(PyObject *module) 
     286{ 
    290287    if (PyType_Ready(&CLoaderType) < 0) 
    291288        return; 
    292  
    293289    Py_INCREF(&CLoaderType); 
    294     PyModule_AddObject(module, "bsl_loader", (PyObject *)&CLoaderType); 
    295 } 
    296  
     290    PyModule_AddObject(module, "CLoader", (PyObject *)&CLoaderType); 
     291} 
    297292 
    298293#define MODULE_DOC "C module for loading bsl." 
     
    312307 
    313308#if PY_MAJOR_VERSION >= 3 
     309 
     310  static PyMethodDef module_methods[] = { 
     311      {NULL} 
     312  }; 
    314313 
    315314  DLL_EXPORT PyMODINIT_FUNC MODULE_INIT3(void) 
     
    326325      NULL,                /* m_free */ 
    327326    }; 
    328         PyObject* m = PyModule_Create(&moduledef); 
    329         addCLoader(m); 
    330         return m; 
     327    PyObject* m = PyModule_Create(&moduledef); 
     328    import_array(); 
     329    addCLoader(m); 
     330    return m; 
    331331  } 
    332332 
     
    335335  DLL_EXPORT PyMODINIT_FUNC MODULE_INIT2(void) 
    336336  { 
    337     PyObject* m = Py_InitModule4(MODULE_NAME, 
    338                  MODULE_METHODS, 
    339                  MODULE_DOC, 
    340                  0, 
    341                  PYTHON_API_VERSION 
    342                  ); 
    343         addCLoader(m); 
     337    PyObject* m = Py_InitModule(MODULE_NAME, NULL); 
     338    import_array(); 
     339    addCLoader(m); 
    344340  } 
    345341 
Note: See TracChangeset for help on using the changeset viewer.