Skip to content

Commit cc77e6b

Browse files
committed
tc-helper: fix minor contexlib abuse
1 parent 08e0d5f commit cc77e6b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: git/test/lib/helper.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,6 @@ def git_daemon_launched(base_path, ip, port):
181181
as_process=True)
182182
# yes, I know ... fortunately, this is always going to work if sleep time is just large enough
183183
time.sleep(0.5 * (1 + is_win))
184-
185-
yield
186-
187184
except Exception as ex:
188185
msg = textwrap.dedent("""
189186
Launching git-daemon failed due to: %s
@@ -203,8 +200,10 @@ def git_daemon_launched(base_path, ip, port):
203200
CYGWIN has no daemon, but if one exists, it gets along fine (but has also paths problems).""")
204201
log.warning(msg, ex, ip, port, base_path, base_path, exc_info=1)
205202

206-
yield
203+
yield # OK, assume daemon started manually.
207204

205+
else:
206+
yield # Yield outside try, to avoid catching
208207
finally:
209208
if gd:
210209
try:

0 commit comments

Comments
 (0)