Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Extract all "import gc" to module level#1765

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 1 commit intogitpython-developers:mainfromEliahKagan:gc-imports
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
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
3 changes: 1 addition & 2 deletionsgit/objects/submodule/base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
# This module is part of GitPython and is released under the
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/

importgc
fromioimportBytesIO
importlogging
importos
Expand DownExpand Up@@ -1079,8 +1080,6 @@ def remove(
self._clear_cache()
wtd=mod.working_tree_dir
delmod# Release file-handles (Windows).
importgc

gc.collect()
rmtree(str(wtd))
# END delete tree if possible
Expand Down
3 changes: 1 addition & 2 deletionstest/performance/test_commit.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@

"""Performance tests for commits (iteration, traversal, and serialization)."""

importgc
fromioimportBytesIO
fromtimeimporttime
importsys
Expand All@@ -17,8 +18,6 @@

classTestPerformance(TestBigRepoRW,TestCommitSerialization):
deftearDown(self):
importgc

gc.collect()

# ref with about 100 commits in its history.
Expand Down
3 changes: 1 addition & 2 deletionstest/performance/test_streams.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@

"""Performance tests for data streaming."""

importgc
importos
importsubprocess
importsys
Expand DownExpand Up@@ -92,8 +93,6 @@ def test_large_data_streaming(self, rwrepo):

# del db file so git has something to do.
ostream=None
importgc

gc.collect()
os.remove(db_file)

Expand Down
3 changes: 1 addition & 2 deletionstest/test_base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@
# This module is part of GitPython and is released under the
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/

importgc
importos
importsys
importtempfile
Expand All@@ -20,8 +21,6 @@

classTestBase(_TestBase):
deftearDown(self):
importgc

gc.collect()

type_tuples= (
Expand Down
3 changes: 1 addition & 2 deletionstest/test_docs.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@
# This module is part of GitPython and is released under the
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/

importgc
importos
importsys

Expand All@@ -16,8 +17,6 @@

classTutorials(TestBase):
deftearDown(self):
importgc

gc.collect()

# ACTUALLY skipped by git.util.rmtree (in local onerror function), from the last call to it via
Expand Down
3 changes: 1 addition & 2 deletionstest/test_git.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@
# This module is part of GitPython and is released under the
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/

importgc
importinspect
importlogging
importos
Expand DownExpand Up@@ -34,8 +35,6 @@ def setUpClass(cls):
cls.git=Git(cls.rorepo.working_dir)

deftearDown(self):
importgc

gc.collect()

def_assert_logged_for_popen(self,log_watcher,name,value):
Expand Down
4 changes: 2 additions & 2 deletionstest/test_quick_doc.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
# This module is part of GitPython and is released under the
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/

importgc

fromtest.libimportTestBase
fromtest.lib.helperimportwith_rw_directory


classQuickDoc(TestBase):
deftearDown(self):
importgc

gc.collect()

@with_rw_directory
Expand Down
3 changes: 1 addition & 2 deletionstest/test_remote.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@
# This module is part of GitPython and is released under the
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/

importgc
importos
importos.pathasosp
frompathlibimportPath
Expand DownExpand Up@@ -105,8 +106,6 @@ def assert_received_message(self):

classTestRemote(TestBase):
deftearDown(self):
importgc

gc.collect()

def_print_fetchhead(self,repo):
Expand Down
3 changes: 1 addition & 2 deletionstest/test_repo.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@
# This module is part of GitPython and is released under the
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/

importgc
importglob
importio
fromioimportBytesIO
Expand DownExpand Up@@ -72,8 +73,6 @@ def tearDown(self):
ifosp.isfile(lfp):
raiseAssertionError("Previous TC left hanging git-lock file: {}".format(lfp))

importgc

gc.collect()

deftest_new_should_raise_on_invalid_repo_location(self):
Expand Down
3 changes: 1 addition & 2 deletionstest/test_submodule.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/

importcontextlib
importgc
importos
importos.pathasosp
frompathlibimportPath
Expand DownExpand Up@@ -61,8 +62,6 @@ def update(self, op, cur_count, max_count, message=""):

classTestSubmodule(TestBase):
deftearDown(self):
importgc

gc.collect()

k_subm_current="c15a6e1923a14bc760851913858a3942a4193cdb"
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp