- Timestamp:
- Sep 28, 2020 10:47:12 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/python/src/PyISupports.cpp
r59809 r86310 221 221 return Py_FindMethodInChain(&this_type->chain, this, (char *)name); 222 222 #else 223 PyMethodChain *chain = &this_type->chain; 224 if (name[0] == '_' && name[1] == '_') 225 { 226 if (!strcmp(name, "__doc__")) 227 { 228 const char *doc = ob_type->tp_doc; 229 if (doc) 230 #if PY_MAJOR_VERSION <= 2 231 return PyString_FromString(doc); 232 #else 233 return PyUnicode_FromString(doc); 234 #endif 235 } 236 } 237 while (chain) 238 { 239 PyMethodDef *ml = chain->methods; 240 for (; ml->ml_name; ml++) 241 { 242 if (!strcmp(name, ml->ml_name)) 243 return PyCFunction_New(ml, this); 244 } 245 chain = chain->link; 246 } 247 PyErr_SetString(PyExc_AttributeError, name); 248 return NULL; 223 PyMethodChain *chain = &this_type->chain; 224 if (name[0] == '_' && name[1] == '_') { 225 if (!strcmp(name, "__doc__")) { 226 const char *doc = ob_type->tp_doc; 227 if (doc) 228 return PyUnicode_FromString(doc); 229 } 230 } 231 while (chain) { 232 PyMethodDef *ml = chain->methods; 233 for (; ml->ml_name; ml++) { 234 if (!strcmp(name, ml->ml_name)) 235 return PyCFunction_New(ml, this); 236 } 237 chain = chain->link; 238 } 239 PyErr_SetString(PyExc_AttributeError, name); 240 return NULL; 249 241 #endif 250 242 }
Note:
See TracChangeset
for help on using the changeset viewer.