Skip to content

Commit 870f449

Browse files
committed
improve coverage issue.
1 parent b0ee43d commit 870f449

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/e3/anod/checkout.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,16 @@ def update_external(
167167
],
168168
output=PIPE,
169169
).out
170-
if ignore_list_lines is None:
171-
ignore_list = []
172-
else:
173-
ignore_list = [
170+
171+
ignore_list = (
172+
[]
173+
if ignore_list_lines is None
174+
else [
174175
f"/{f.strip().rstrip('/')}"
175176
for f in ignore_list_lines.splitlines()
176177
]
177-
logger.debug("Ignore in external: %s", ignore_list)
178+
)
179+
logger.debug("Ignore in external: %s", ignore_list)
178180
except Exception: # defensive code
179181
# don't crash on exception
180182
pass
@@ -231,9 +233,7 @@ def update_git(
231233
try:
232234
output_str = g.git_cmd(["remote"], output=PIPE).out
233235

234-
remote_list = []
235-
if output_str:
236-
remote_list = output_str.splitlines()
236+
remote_list = output_str.splitlines() if output_str else []
237237

238238
if remote_name not in remote_list:
239239
g.git_cmd(["remote", "add", remote_name, url])

src/e3/os/process.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,7 @@ def out(self) -> Optional[str]:
484484
utf-8 a string representation will be returned
485485
(see e3.text.bytes_as_str).
486486
"""
487-
if self.raw_out is None:
488-
return None
489-
return bytes_as_str(self.raw_out)
487+
return bytes_as_str(self.raw_out) if self.raw_out is not None else None
490488

491489
@property
492490
def err(self) -> Optional[str]:

0 commit comments

Comments
 (0)