-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
bpo-1635741: Port _gdbm module to multiphase initialization #20920
Conversation
I' ve checked the memory leak with these scripts and no leaks found
def test_gdbm(self):
code = textwrap.dedent(r"""
import glob
import test.support
dbm = test.support.import_module('_gdbm')
# or dbm = test.support.import_module('dbm')
_fname = test.support.TESTFN
def delete_files():
for f in glob.glob(_fname + "*"):
test.support.unlink(f)
f = dbm.open(_fname, 'n')
f[b'g'] = b"indented"
f.close()
delete_files()
""")
ret = test.support.run_in_subinterp(code)
self.assertEqual(ret, 0) |
Note that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Minor remarks:
- I'm not sure why only a few methods uses the defining class, whereas some others use Py_TYPE(self).
- nitpick: some "clinic input" uses an empty line betwen the function name and its parameters, sometimes there is none.
But I don't think that it's worth it to address these minor things. If you care, you may also update _dbmmodule.c. Maybe in a follow-up PRs.
Maybe open an issue to track this bug. |
Well, I added a comment to: https://bugs.python.org/issue40987#msg371679 |
Oh I mean the subinterpreter test with |
@vstinner Thanks for the review! |
Oh ok, that's great! Sorry, I misunderstood your comment. |
https://bugs.python.org/issue1635741