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

corona10
Copy link
Member

@corona10 corona10 commented Jun 13, 2020

@corona10
Copy link
Member Author

@shihai1991 PTAL!

@corona10
Copy link
Member Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shihai1991 Thanks shihai! I've updated it

Copy link
Member

@shihai1991 shihai1991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the requested changes; please review again

@corona10 corona10 requested a review from vstinner June 15, 2020 15:05
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 June 16, 2020 00:20
Co-authored-by: Victor Stinner <vstinner@python.org>
@corona10 corona10 requested a review from vstinner June 15, 2020 15:24
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 June 15, 2020 15:56
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@corona10 corona10 merged commit bf69a8f into python:master Jun 15, 2020
@corona10 corona10 deleted the bpo-1635741-dbm branch June 15, 2020 16:21
arun-mani-j pushed a commit to arun-mani-j/cpython that referenced this pull request Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants