-
Notifications
You must be signed in to change notification settings - Fork 756
Python 3.8 #1138
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
Python 3.8 #1138
Changes from 2 commits
d4eac3a
b17b9d3
a9b91a3
e213a97
a7949b9
c6ae15b
8e54d26
ed2b7e8
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ python: | |
- 3.5 | ||
- 3.6 | ||
- 3.7 | ||
- 3.8 | ||
|
||
env: | ||
matrix: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,6 +280,14 @@ internal static IntPtr CreateSubType(IntPtr py_name, IntPtr py_base_type, IntPtr | |
IntPtr cls_dict = Marshal.ReadIntPtr(py_type, TypeOffset.tp_dict); | ||
Runtime.PyDict_Update(cls_dict, py_dict); | ||
|
||
// Update the __classcell__ if it exists | ||
IntPtr cell = Runtime.PyDict_GetItemString(cls_dict, "__classcell__"); | ||
if (cell != IntPtr.Zero) | ||
{ | ||
Runtime.PyCell_Set(cell, py_type); | ||
Runtime.PyDict_DelItemString(cls_dict, "__classcell__"); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @filmor I can't find a test, that would cover this scenario, and I suspect there might be a problem with reference counting: if Also, I don't understand why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NVM, I found the code to be replica of https://github.com/python/cpython/blob/145bf269df3530176f6ebeab1324890ef7070bf8/Objects/typeobject.c#L2844 |
||
return py_type; | ||
} | ||
catch (Exception e) | ||
|
Uh oh!
There was an error while loading. Please reload this page.