Skip to content
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

gh-103092: Isolate winreg #103250

Merged
merged 34 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c26eadc
gh-103092: isolate winreg
aisk Apr 4, 2023
cb77580
Update PC/winreg.c
aisk Apr 6, 2023
1f0ecc0
finish the isolate
aisk Apr 7, 2023
d48fc88
add tests for winreg
aisk Apr 7, 2023
2201037
add news
aisk Apr 7, 2023
71547ef
Update Lib/test/test_winreg.py
aisk Apr 9, 2023
1b5b873
Update Misc/NEWS.d/next/Library/2023-04-08-00-48-40.gh-issue-103092.5…
aisk Apr 9, 2023
a4eb9c5
Update PC/winreg.c
aisk Apr 9, 2023
179416a
Update PC/winreg.c
aisk Apr 9, 2023
73f3ffe
Update PC/winreg.c
aisk Apr 9, 2023
dff3839
Update PC/winreg.c
aisk Apr 9, 2023
8623719
Update PC/winreg.c
aisk Apr 9, 2023
3f1cd90
fix gc track on PyHKEY
aisk Apr 9, 2023
f3da318
using Py_Type to get class instead of using defining_class and
aisk Apr 9, 2023
a2017d1
fix the memory leak
aisk Apr 9, 2023
80af80c
Update PC/winreg.c
aisk Apr 10, 2023
9da5f0e
Update PC/winreg.c
aisk Apr 10, 2023
a06b9b5
Update PC/winreg.c
aisk Apr 10, 2023
0d7249a
Update PC/winreg.c
aisk Apr 10, 2023
488cae8
Update PC/winreg.c
aisk Apr 10, 2023
bbd1d6d
Update PC/winreg.c
aisk Apr 10, 2023
45fedf6
Update PC/winreg.c
aisk Apr 10, 2023
964e1dd
Update PC/winreg.c
aisk Apr 10, 2023
16de5c6
Update PC/winreg.c
aisk Apr 10, 2023
0572407
Update PC/winreg.c
aisk Apr 10, 2023
ae54a8e
nit fixes
aisk Apr 10, 2023
42bcb44
fix syntax error
aisk Apr 10, 2023
1998c06
passing state instead of module in c level module functions
aisk Apr 10, 2023
682c419
Update PC/winreg.c
aisk Apr 11, 2023
8b1aaa4
check result of gc new
aisk Apr 11, 2023
25a7f73
Merge remote-tracking branch 'upstream/main' into isolate-winreg
aisk Apr 11, 2023
3ecc718
Update PC/winreg.c
aisk Apr 12, 2023
e279c84
remove unused PyHKEY_NumberMethods
aisk Apr 12, 2023
d7f97fc
Update PC/winreg.c
erlend-aasland Apr 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Lib/test/test_winreg.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey

import gc
import os, sys, errno
import unittest
from test.support import import_helper
import threading
import unittest
from platform import machine, win32_edition
from test.support import cpython_only, import_helper

# Do this first so test will be skipped if module doesn't exist
import_helper.import_module('winreg', required_on=['win'])
Expand Down Expand Up @@ -49,6 +50,17 @@
("Japanese 日本", "日本語", REG_SZ),
]


@cpython_only
class HeapTypeTests(unittest.TestCase):
def test_have_gc(self):
self.assertTrue(gc.is_tracked(HKEYType))

def test_immutable(self):
with self.assertRaisesRegex(TypeError, "immutable"):
HKEYType.foo = "bar"

aisk marked this conversation as resolved.
Show resolved Hide resolved

class BaseWinregTests(unittest.TestCase):

def setUp(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adapt the :mod:`winreg` extension module to :pep:`687`.
6 changes: 0 additions & 6 deletions Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1965,9 +1965,6 @@ PyObject _Py_NotImplementedStruct = {
1, &_PyNotImplemented_Type
};

#ifdef MS_WINDOWS
extern PyTypeObject PyHKEY_Type;
#endif
extern PyTypeObject _Py_GenericAliasIterType;
extern PyTypeObject _PyMemoryIter_Type;
extern PyTypeObject _PyLineIterator;
Expand Down Expand Up @@ -2017,9 +2014,6 @@ static PyTypeObject* static_types[] = {
&PyFunction_Type,
&PyGen_Type,
&PyGetSetDescr_Type,
#ifdef MS_WINDOWS
&PyHKEY_Type,
#endif
&PyInstanceMethod_Type,
&PyListIter_Type,
&PyListRevIter_Type,
Expand Down
54 changes: 27 additions & 27 deletions PC/clinic/winreg.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading