| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,7 +67,7 @@ public virtual IntPtr type_subscript(IntPtr idx) | |||
| 67 | 67 | //==================================================================== | |
| 68 | 68 | // Standard comparison implementation for instances of reflected types. | |
| 69 | 69 | //==================================================================== | |
| 70 | - #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) | ||
| 70 | + | ||
| 71 | 71 | public static IntPtr tp_richcompare(IntPtr ob, IntPtr other, int op) { | |
| 72 | 72 | CLRObject co1; | |
| 73 | 73 | CLRObject co2; | |
@@ -169,27 +169,6 @@ public static IntPtr tp_richcompare(IntPtr ob, IntPtr other, int op) { | |||
| 169 | 169 | return Runtime.PyNotImplemented; | |
| 170 | 170 | } | |
| 171 | 171 | } | |
| 172 | - #else | ||
| 173 | - public static int tp_compare(IntPtr ob, IntPtr other) | ||
| 174 | - { | ||
| 175 | - if (ob == other) | ||
| 176 | - { | ||
| 177 | - return 0; | ||
| 178 | - } | ||
| 179 | - | ||
| 180 | - CLRObject co1 = GetManagedObject(ob) as CLRObject; | ||
| 181 | - CLRObject co2 = GetManagedObject(other) as CLRObject; | ||
| 182 | - Object o1 = co1.inst; | ||
| 183 | - Object o2 = co2.inst; | ||
| 184 | - | ||
| 185 | - if (Object.Equals(o1, o2)) | ||
| 186 | - { | ||
| 187 | - return 0; | ||
| 188 | - } | ||
| 189 | - return -1; | ||
| 190 | - } | ||
| 191 | - #endif | ||
| 192 | - | ||
| 193 | 172 | ||
| 194 | 173 | //==================================================================== | |
| 195 | 174 | // Standard iteration support for instances of reflected types. This | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -232,13 +232,13 @@ internal static void Initialize() | |||
| 232 | 232 | } | |
| 233 | 233 | ||
| 234 | 234 | #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) | |
| 235 | - IntPtr op = Runtime.PyImport_ImportModule("builtins"); | ||
| 236 | - IntPtr dict = Runtime.PyObject_GetAttrString(op, "__dict__"); | ||
| 237 | - PyNotImplemented = Runtime.PyObject_GetAttrString(op, "NotImplemented"); | ||
| 235 | + IntPtr op = Runtime.PyImport_ImportModule("builtins"); | ||
| 236 | + IntPtr dict = Runtime.PyObject_GetAttrString(op, "__dict__"); | ||
| 238 | 237 | #else | |
| 239 | 238 | IntPtr dict = Runtime.PyImport_GetModuleDict(); | |
| 240 | 239 | IntPtr op = Runtime.PyDict_GetItemString(dict, "__builtin__"); | |
| 241 | 240 | #endif | |
| 241 | + PyNotImplemented = Runtime.PyObject_GetAttrString(op, "NotImplemented"); | ||
| 242 | 242 | PyBaseObjectType = Runtime.PyObject_GetAttrString(op, "object"); | |
| 243 | 243 | ||
| 244 | 244 | PyModuleType = Runtime.PyObject_Type(op); | |
@@ -263,7 +263,7 @@ internal static void Initialize() | |||
| 263 | 263 | Runtime.XDecref(op); | |
| 264 | 264 | ||
| 265 | 265 | #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) | |
| 266 | - Runtime.XDecref(dict); | ||
| 266 | + Runtime.XDecref(dict); | ||
| 267 | 267 | #endif | |
| 268 | 268 | ||
| 269 | 269 | op = Runtime.PyString_FromString("string"); | |
@@ -275,9 +275,9 @@ internal static void Initialize() | |||
| 275 | 275 | Runtime.XDecref(op); | |
| 276 | 276 | ||
| 277 | 277 | #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) | |
| 278 | - op = Runtime.PyBytes_FromString("bytes"); | ||
| 279 | - PyBytesType = Runtime.PyObject_Type(op); | ||
| 280 | - Runtime.XDecref(op); | ||
| 278 | + op = Runtime.PyBytes_FromString("bytes"); | ||
| 279 | + PyBytesType = Runtime.PyObject_Type(op); | ||
| 280 | + Runtime.XDecref(op); | ||
| 281 | 281 | #endif | |
| 282 | 282 | ||
| 283 | 283 | op = Runtime.PyTuple_New(0); | |
@@ -397,17 +397,18 @@ internal static int AtExit() | |||
| 397 | 397 | internal static IntPtr PyTypeType; | |
| 398 | 398 | ||
| 399 | 399 | #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) | |
| 400 | - internal static IntPtr PyBytesType; | ||
| 401 | - internal static IntPtr PyNotImplemented; | ||
| 402 | - internal const int Py_LT = 0; | ||
| 403 | - internal const int Py_LE = 1; | ||
| 404 | - internal const int Py_EQ = 2; | ||
| 405 | - internal const int Py_NE = 3; | ||
| 406 | - internal const int Py_GT = 4; | ||
| 407 | - internal const int Py_GE = 5; | ||
| 408 | - internal static IntPtr _PyObject_NextNotImplemented; | ||
| 400 | + internal static IntPtr PyBytesType; | ||
| 401 | + internal static IntPtr _PyObject_NextNotImplemented; | ||
| 409 | 402 | #endif | |
| 410 | 403 | ||
| 404 | + internal static IntPtr PyNotImplemented; | ||
| 405 | + internal const int Py_LT = 0; | ||
| 406 | + internal const int Py_LE = 1; | ||
| 407 | + internal const int Py_EQ = 2; | ||
| 408 | + internal const int Py_NE = 3; | ||
| 409 | + internal const int Py_GT = 4; | ||
| 410 | + internal const int Py_GE = 5; | ||
| 411 | + | ||
| 411 | 412 | internal static IntPtr PyTrue; | |
| 412 | 413 | internal static IntPtr PyFalse; | |
| 413 | 414 | internal static IntPtr PyNone; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments