Skip to content

bpo-42064: Adapt sqlite3 to multi-phase init (PEP 489) #29234

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

Merged
merged 3 commits into from
Nov 2, 2021

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Oct 27, 2021

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Oct 27, 2021

$ cat measure.py
import gc
import sys

for _ in range(5):
    gc.collect()
    before = sys.gettotalrefcount()

    import sqlite3
    del sys.modules['sqlite3']
    del sqlite3

    gc.collect()
    after = sys.gettotalrefcount()

    print(f"{before=}, {after=}")

$ ./python.exe measure.py
before=51469, after=66883
before=66892, after=66892
before=66892, after=66892
before=66892, after=66892
before=66892, after=66892 

Thank you so much for helping reviewing and improving this, @corona10, @vstinner, @encukou!

For a list of PR's:
$ git log --grep "bpo-\(42064\|41861\|40956\|42862\)" --oneline

@erlend-aasland
Copy link
Contributor Author

See GH-29230 regarding the docs CI failure.

@encukou
Copy link
Member

encukou commented Oct 27, 2021

See GH-29230 regarding the docs CI failure.

PRs can't be merged without passing tests. Could you merge the main branch in?

@encukou encukou merged commit 401272e into python:main Nov 2, 2021
@erlend-aasland erlend-aasland deleted the sqlite-multiphase-init branch November 2, 2021 18:02
@vstinner
Copy link
Member

vstinner commented Nov 9, 2021

Nice! Well done @erlend-aasland!

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.

5 participants