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

Skip to content

Commit ae18126

Browse files
CronanAlexCatarino
authored andcommitted
Removes imports deprecated in Python3 (pythonnet#925)
1 parent c835ced commit ae18126

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
@@ -778,8 +778,10 @@ public static extern int Py_Main(
778778
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
779779
internal static extern IntPtr PyCFunction_Call(IntPtr func, IntPtr args, IntPtr kw);
780780

781+
#if PYTHON2
781782
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
782783
internal static extern IntPtr PyClass_New(IntPtr bases, IntPtr dict, IntPtr name);
784+
#endif
783785

784786
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
785787
internal static extern IntPtr PyInstance_New(IntPtr cls, IntPtr args, IntPtr kw);
@@ -1021,10 +1023,6 @@ internal static IntPtr PyInt_FromInt64(long value)
10211023
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
10221024
EntryPoint = "PyLong_FromString")]
10231025
internal static extern IntPtr PyInt_FromString(string value, IntPtr end, int radix);
1024-
1025-
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
1026-
EntryPoint = "PyLong_GetMax")]
1027-
internal static extern int PyInt_GetMax();
10281026
#elif PYTHON2
10291027
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
10301028
private static extern IntPtr PyInt_FromLong(IntPtr value);

0 commit comments

Comments
 (0)
0