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

bpo-1635741: Port _dbm module to multiphase initialization #20848

Merged
merged 9 commits into from Jun 15, 2020

Conversation

Copy link
Member

@corona10 corona10 commented Jun 13, 2020

@corona10
Copy link
Author

@corona10 corona10 commented Jun 13, 2020

@shihai1991 PTAL!

@corona10
Copy link
Author

@corona10 corona10 commented Jun 13, 2020

I' ve checked the memory leak with these scripts and no leaks found

./python.exe -m test test_dbm  -R 3:3
def test_dbm(self):
    code = textwrap.dedent(r"""
        import glob

        import test.support
        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)

Modules/_dbmmodule.c Outdated Show resolved Hide resolved
Copy link
Member Author

@corona10 corona10 left a comment

@shihai1991 Thanks shihai! I've updated it

Copy link
Member

@shihai1991 shihai1991 left a comment

Thanks, LGTM.

Modules/_dbmmodule.c Show resolved Hide resolved
Modules/_dbmmodule.c Show resolved Hide resolved
Modules/_dbmmodule.c Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jun 15, 2020

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

Copy link
Member Author

@corona10 corona10 left a comment

I have made the requested changes; please review again

@corona10 corona10 requested a review from vstinner Jun 15, 2020
Modules/_dbmmodule.c Outdated Show resolved Hide resolved
Modules/_dbmmodule.c Outdated Show resolved Hide resolved
Modules/_dbmmodule.c Outdated Show resolved Hide resolved
corona10 and others added 2 commits Jun 15, 2020
Co-authored-by: Victor Stinner <vstinner@python.org>
@corona10 corona10 requested a review from vstinner Jun 15, 2020
Copy link
Member

@vstinner vstinner left a comment

Thanks! It's now much better!

Modules/_dbmmodule.c Outdated Show resolved Hide resolved
Modules/_dbmmodule.c Outdated Show resolved Hide resolved
Modules/_dbmmodule.c Show resolved Hide resolved
Modules/_dbmmodule.c Show resolved Hide resolved
Modules/_dbmmodule.c Outdated Show resolved Hide resolved
@corona10 corona10 requested a review from vstinner Jun 15, 2020
Copy link
Member

@vstinner vstinner left a comment

LGTM, thanks!

@corona10 corona10 merged commit bf69a8f into python:master Jun 15, 2020
10 checks passed
@corona10 corona10 deleted the bpo-1635741-dbm branch Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants