Skip to content

Commit bdbea6a

Browse files
author
Barton Cline
committed
PYTHON27 option added.
1 parent 4c46644 commit bdbea6a

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

pythonnet/src/runtime/runtime.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,22 @@ public class Runtime {
5656
public const string pyversion = "2.6";
5757
public const int pyversionnumber = 26;
5858
#endif
59-
#if ! (PYTHON23 || PYTHON24 || PYTHON25 || PYTHON26)
60-
#error You must define one of PYTHON23 to PYTHON26
59+
#if (PYTHON27)
60+
public const string dll = "python27";
61+
public const string pyversion = "2.7";
62+
public const int pyversionnumber = 27;
6163
#endif
62-
internal static bool wrap_exceptions;
63-
internal static bool is32bit;
64+
#if ! (PYTHON23 || PYTHON24 || PYTHON25 || PYTHON26 || PYTHON27)
65+
#error You must define one of PYTHON23 to PYTHON27
66+
#endif
67+
68+
internal static bool wrap_exceptions;
69+
internal static bool is32bit;
6470

65-
internal static void Initialize() {
71+
/// <summary>
72+
/// Intitialize the runtime...
73+
/// </summary>
74+
internal static void Initialize() {
6675

6776
is32bit = IntPtr.Size == 4;
6877

@@ -138,7 +147,7 @@ internal static void Initialize() {
138147
// of the Python runtime that do not allow new-style classes to
139148
// be used as exceptions (Python versions 2.4 and lower).
140149

141-
#if (PYTHON25 || PYTHON26)
150+
#if (PYTHON25 || PYTHON26 || PYTHON27)
142151
wrap_exceptions = false;
143152
#else
144153
IntPtr m = PyImport_ImportModule("exceptions");

pythonnet/src/runtime/typemanager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ internal static IntPtr CreateType(ManagedType impl, Type clrType) {
127127
// XXX Hack, use a different base class for System.Exception
128128
// Python 2.5+ allows new style class exceptions but they *must*
129129
// subclass BaseException (or better Exception).
130-
#if (PYTHON25 || PYTHON26)
130+
#if (PYTHON25 || PYTHON26 || PYTHON27)
131131
if (clrType == typeof(System.Exception)) {
132132
base_ = Exceptions.Exception;
133133
Runtime.Incref(base_);

0 commit comments

Comments
 (0)