Skip to content

Commit 631d489

Browse files
committed
chore(ruff): Fix common exception
1 parent 6790686 commit 631d489

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libtmux/common.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def show_environment(self) -> Dict[str, Union[bool, str]]:
151151
elif len(_t) == 1:
152152
vars_dict[_t[0]] = True
153153
else:
154-
raise ValueError(f"unexpected variable {_t}")
154+
raise exc.VariableUnpackingError(variable=_t)
155155

156156
return vars_dict
157157

@@ -188,7 +188,7 @@ def getenv(self, name: str) -> Optional[t.Union[str, bool]]:
188188
elif len(_t) == 1:
189189
vars_dict[_t[0]] = True
190190
else:
191-
raise ValueError(f"unexpected variable {_t}")
191+
raise exc.VariableUnpackingError(variable=_t)
192192

193193
return vars_dict.get(name)
194194

@@ -242,8 +242,8 @@ def __init__(self, *args: t.Any, **kwargs: t.Any) -> None:
242242
)
243243
stdout, stderr = self.process.communicate()
244244
returncode = self.process.returncode
245-
except Exception as e:
246-
logger.error(f"Exception for {subprocess.list2cmdline(cmd)}: \n{e}")
245+
except Exception:
246+
logger.exception(f"Exception for {subprocess.list2cmdline(cmd)}")
247247
raise
248248

249249
self.returncode = returncode

0 commit comments

Comments
 (0)