File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 7
7
8
8
import contextlib
9
9
from functools import wraps
10
+ import gc
10
11
import io
11
12
import logging
12
13
import os
18
19
19
20
from git .compat import string_types , is_win , PY3
20
21
from git .util import rmtree , cwd
22
+ import gitdb
21
23
22
24
import os .path as osp
23
25
@@ -92,7 +94,6 @@ def wrapper(self):
92
94
# a windows-only issue. In fact things should be deleted, as well as
93
95
# memory maps closed, once objects go out of scope. For some reason
94
96
# though this is not the case here unless we collect explicitly.
95
- import gc
96
97
gc .collect ()
97
98
if not keep :
98
99
rmtree (path )
@@ -140,9 +141,10 @@ def repo_creator(self):
140
141
os .chdir (prev_cwd )
141
142
rw_repo .git .clear_cache ()
142
143
rw_repo = None
143
- import gc
144
- gc .collect ()
145
144
if repo_dir is not None :
145
+ gc .collect ()
146
+ gitdb .util .mman .collect ()
147
+ gc .collect ()
146
148
rmtree (repo_dir )
147
149
# END rm test repo if possible
148
150
# END cleanup
@@ -299,7 +301,8 @@ def remote_repo_creator(self):
299
301
rw_daemon_repo .git .clear_cache ()
300
302
del rw_repo
301
303
del rw_daemon_repo
302
- import gc
304
+ gc .collect ()
305
+ gitdb .util .mman .collect ()
303
306
gc .collect ()
304
307
if rw_repo_dir :
305
308
rmtree (rw_repo_dir )
@@ -350,7 +353,6 @@ def setUpClass(cls):
350
353
each test type has its own repository
351
354
"""
352
355
from git import Repo
353
- import gc
354
356
gc .collect ()
355
357
cls .rorepo = Repo (GIT_REPO )
356
358
You can’t perform that action at this time.
0 commit comments