8000 Removes imports deprecated in Python3 (#925) · pythonnet/pythonnet@1ce630e · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ce630e

Browse files
Cronanfilmor
authored andcommitted
Removes imports deprecated in Python3 (#925)
1 parent 6f635a4 commit 1ce630e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
1515

1616
- Added argument types information to "No method matches given arguments" message
1717
- Moved wheel import in setup.py inside of a try/except to prevent pip collection failures
18+
- Removes PyLong_GetMax and PyClass_New when targetting Python3
1819

1920
### Fixed
2021

src/runtime/runtime.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,10 @@ public static extern int Py_Main(
769769
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
770770
internal static extern IntPtr PyCFunction_Call(IntPtr func, IntPtr args, IntPtr kw);
771771

772+
#if PYTHON2
772773
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
773774
internal static extern IntPtr PyClass_New(IntPtr bases, IntPtr dict, IntPtr name);
775+
#endif
774776

775777
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
776778
internal static extern IntPtr PyInstance_New(IntPtr cls, IntPtr args, IntPtr kw);
@@ -1012,10 +1014,6 @@ internal static IntPtr PyInt_FromInt64(long value)
10121014
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
10131015
EntryPoint = "PyLong_FromString")]
10141016
internal static extern IntPtr PyInt_FromString(string value, IntPtr end, int radix);
1015-
1016-
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
1017-
EntryPoint = "PyLong_GetMax")]
1018-
internal static extern int PyInt_GetMax();
10191017
#elif PYTHON2
10201018
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
10211019
private static extern IntPtr PyInt_FromLong(IntPtr value);

0 commit comments

Comments
 (0)
0