File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -208,15 +208,21 @@ def __exit__(
208208 for patch in self .__patches :
209209 patch .stop ()
210210
211- if self .__temp_dir is not None :
212- self .__temp_dir .cleanup ()
211+ if self .__rs and self .__rs .repo :
212+ self .__rs .repo .close ()
213+ if self .__rs_remote and self .__rs_remote .repo :
214+ self .__rs_remote .repo .close ()
213215
214216 if self .__rs_context is not None :
215217 self .__rs_context .__exit__ (exc_type , exc_val , None )
216218
217219 if self .__rs_remote_context is not None :
218220 self .__rs_remote_context .__exit__ (exc_type , exc_val , None )
219221
222+ if self .__temp_dir is not None :
223+ os .chdir (Path (self .__temp_dir .name ).parent )
224+ self .__temp_dir .cleanup ()
225+
220226 if self .__remote_temp_dir is not None :
221227 self .__remote_temp_dir .cleanup ()
222228
You can’t perform that action at this time.
0 commit comments