VirtualBox

Changeset 86310 in vbox for trunk


Ignore:
Timestamp:
Sep 28, 2020 10:47:12 AM (4 years ago)
Author:
vboxsync
Message:

xpcom/python: Indentation fixes in py3 changes. bugref:9840

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/python/src/PyISupports.cpp

    r59809 r86310  
    221221        return Py_FindMethodInChain(&this_type->chain, this, (char *)name);
    222222#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;
    249241#endif
    250242}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette