From 8f15b0427bc2dcf739cc286c4605537734018f3d Mon Sep 17 00:00:00 2001 From: Shawn Brown Date: Sat, 11 Sep 2021 13:23:06 -0400 Subject: [PATCH] Avoid reuse of variable name for values of different types. Mypy just doesn't like this when it's done in the local scope (see python/mypy#1174). --- envlauncher/launchers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/envlauncher/launchers.py b/envlauncher/launchers.py index 3a62399..536aef7 100644 --- a/envlauncher/launchers.py +++ b/envlauncher/launchers.py @@ -330,10 +330,10 @@ def build_args(object_path, method, *contents) -> List[str]: @staticmethod def parse_session_id(reply: bytes) -> int: """Takes an `addSession` reply and returns the id as an int.""" - reply = str(reply, encoding=sys.stdout.encoding) - matched = re.search(r'(?:int16|int32|int64)[ ](\d+)', reply) + reply_str = str(reply, encoding=sys.stdout.encoding) + matched = re.search(r'(?:int16|int32|int64)[ ](\d+)', reply_str) if not matched: - msg = f'Unable to get Yakuake tab session-id: {reply!r}' + msg = f'Unable to get Yakuake tab session-id: {reply_str!r}' raise RuntimeError(msg) return int(matched.group(1))