8000 Refactor directives by vmuriart · Pull Request #324 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Refactor directives #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 12, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove redundant #if directives
Not relevant after dropping Python 24, Python 25
  • Loading branch information
vmuriart committed Jan 12, 2017
commit 935c6538003e5a96d3608269a704964ec6d1242d
6 changes: 0 additions & 6 deletions src/runtime/exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,10 @@ internal static IntPtr RaiseTypeError(string message)
puplic static variables on the Exceptions class filled in from
the python class using reflection in Initialize() looked up by
name, not posistion. */
#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
public static IntPtr BaseException;
#endif
public static IntPtr Exception;
public static IntPtr StopIteration;
#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
public static IntPtr GeneratorExit;
#endif
#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
public static IntPtr StandardError;
#endif
Expand Down Expand Up @@ -436,10 +432,8 @@ puplic static variables on the Exceptions class filled in from
public static IntPtr SyntaxWarning;
public static IntPtr RuntimeWarning;
public static IntPtr FutureWarning;
#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
public static IntPtr ImportWarning;
public static IntPtr UnicodeWarning;
//PyAPI_DATA(PyObject *) PyExc_BytesWarning;
#endif
}
}
8 changes: 1 addition & 7 deletions src/runtime/interop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,7 @@ internal class TypeFlags
/* XXX Reusing reserved constants */
public static int Managed = (1 << 15); // PythonNet specific
public static int Subclass = (1 << 16); // PythonNet specific
#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
public static int HaveIndex = (1 << 17);
#endif
#if (PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
/* Objects support nb_index in PyNumberMethods */
public static int HaveVersionTag = (1 << 18);
public static int ValidVersionTag = (1 << 19);
Expand All @@ -311,7 +308,6 @@ internal class TypeFlags
public static int DictSubclass = (1 << 29);
public static int BaseExceptionSubclass = (1 << 30);
public static int TypeSubclass = (1 << 31);
#endif

// Default flags for Python 2
#if (PYTHON23 || PYTHON24 || PYTHON25 || PYTHON26 || PYTHON27)
Expand Down Expand Up @@ -433,9 +429,7 @@ static Interop()
pmap["nb_true_divide"] = p["BinaryFunc"];
pmap["nb_inplace_floor_divide"] = p["BinaryFunc"];
pmap["nb_inplace_true_divide"] = p["BinaryFunc"];
#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36)
pmap["nb_index"] = p["UnaryFunc"];
#endif

pmap["sq_length"] = p["InquiryFunc"];
pmap["sq_concat"] = p["BinaryFunc"];
Expand Down Expand Up @@ -536,4 +530,4 @@ public Thunk(Delegate d)
fn = d;
}
}
}
}
0