Skip to content

Commit de38336

Browse files
Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 6fbaf92 commit de38336

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Lib/test/test_capi/test_weakref.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def test_pyweakref_newref(self):
9494
obj = Object()
9595
wr = newref(obj)
9696
self.assertIs(type(wr), weakref.ReferenceType)
97+
# PyWeakref_NewRef() handles None callback as NULL callback
9798
wr = newref(obj, None)
9899
self.assertIs(type(wr), weakref.ReferenceType)
99100
log = []
@@ -112,6 +113,7 @@ def test_pyweakref_newproxy(self):
112113
obj = Object()
113114
wp = newproxy(obj)
114115
self.assertIs(type(wp), weakref.ProxyType)
116+
# PyWeakref_NewProxy() handles None callback as NULL callback
115117
wp = newproxy(obj, None)
116118
self.assertIs(type(wp), weakref.ProxyType)
117119
log = []

Modules/_testlimitedcapi/weakref.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "pyconfig.h" // Py_GIL_DISABLED
22
#ifndef Py_GIL_DISABLED
3-
// Need limited C API 3.13 for PyLong_AsInt()
4-
# define Py_LIMITED_API 0x030d0000
3+
// Need limited C API 3.5 for PyModule_AddFunctions()
4+
# define Py_LIMITED_API 0x03050000
55
#endif
66

77
#include "parts.h"

0 commit comments

Comments
 (0)