Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 935c653

Browse files
committed
Remove redundant #if directives
Not relevant after dropping Python 24, Python 25
1 parent 51d2911 commit 935c653

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

src/runtime/exceptions.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,10 @@ internal static IntPtr RaiseTypeError(string message)
371371
puplic static variables on the Exceptions class filled in from
372372
the python class using reflection in Initialize() looked up by
373373
name, not posistion. */
374-
#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
375374
public static IntPtr BaseException;
376-
#endif
377375
public static IntPtr Exception;
378376
public static IntPtr StopIteration;
379-
#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
380377
public static IntPtr GeneratorExit;
381-
#endif
382378
#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
383379
public static IntPtr StandardError;
384380
#endif
@@ -436,10 +432,8 @@ puplic static variables on the Exceptions class filled in from
436432
public static IntPtr SyntaxWarning;
437433
public static IntPtr RuntimeWarning;
438434
public static IntPtr FutureWarning;
439-
#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
440435
public static IntPtr ImportWarning;
441436
public static IntPtr UnicodeWarning;
442437
//PyAPI_DATA(PyObject *) PyExc_BytesWarning;
443-
#endif
444438
}
445439
}

src/runtime/interop.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,7 @@ internal class TypeFlags
292292
/* XXX Reusing reserved constants */
293293
public static int Managed = (1 << 15); // PythonNet specific
294294
public static int Subclass = (1 << 16); // PythonNet specific
295-
#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
296295
public static int HaveIndex = (1 << 17);
297-
#endif
298-
#if (PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
299296
/* Objects support nb_index in PyNumberMethods */
300297
public static int HaveVersionTag = (1 << 18);
301298
public static int ValidVersionTag = (1 << 19);
@@ -311,7 +308,6 @@ internal class TypeFlags
311308
public static int DictSubclass = (1 << 29);
312309
public static int BaseExceptionSubclass = (1 << 30);
313310
public static int TypeSubclass = (1 << 31);
314-
#endif
315311

316312
// Default flags for Python 2
317313
#if (PYTHON23 || PYTHON24 || PYTHON25 || PYTHON26 || PYTHON27)
@@ -433,9 +429,7 @@ static Interop()
433429
pmap["nb_true_divide"] = p["BinaryFunc"];
434430
pmap["nb_inplace_floor_divide"] = p["BinaryFunc"];
435431
pmap["nb_inplace_true_divide"] = p["BinaryFunc"];
436-
#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
437432
pmap["nb_index"] = p["UnaryFunc"];
438-
#endif
439433

440434
pmap["sq_length"] = p["InquiryFunc"];
441435
pmap["sq_concat"] = p["BinaryFunc"];
@@ -536,4 +530,4 @@ public Thunk(Delegate d)
536530
fn = d;
537531
}
538532
}
539-
}
533+
}

0 commit comments

Comments
 (0)