Changeset 927 for trunk


Ignore:
Timestamp:
May 28, 2019, 11:44:36 AM (6 years ago)
Author:
djay
Message:

Declare const char* only for Python 3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal_python.c

    r926 r927  
    351351  PyObject *ptype, *pvalue, *ptraceback,*pValue,*pArgs;
    352352  PyErr_Fetch(&ptype, &pvalue, &ptraceback);
    353   const char *pStrErrorMessage = PyString_AsString(pvalue);
     353#if PY_MAJOR_VERSION >= 3 
     354  const
     355#endif
     356    char *pStrErrorMessage = PyString_AsString(pvalue);
    354357  char *tmp0=_("Python module %s cannot be loaded. Message: %s\n");
    355358 
     
    698701    if(strncmp(PyString_AsString(key),"child",5)!=0){
    699702      if(strncmp(PyString_AsString(key),"value",5)==0){
    700         const char *buffer=NULL;
     703#if PY_MAJOR_VERSION >= 3 
     704        const
     705#endif
     706          char *buffer=NULL;
    701707        Py_ssize_t size;
    702708#if PY_MAJOR_VERSION >= 3
     
    720726        res = addToMapWithSize(res,PyString_AsString(key),buffer,size);
    721727      }else{
    722         const char* lkey=PyString_AsString(key);
    723         const char* lvalue=PyString_AsString(value);
     728#if PY_MAJOR_VERSION >= 3 
     729        const
     730#endif
     731          char* lkey=PyString_AsString(key);
     732#if PY_MAJOR_VERSION >= 3 
     733        const
     734#endif
     735          char* lvalue=PyString_AsString(value);
    724736        if(res!=NULL){
    725737          if(PyString_Size(value)>0)
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png