From 2fa64737cb2d341db454f686d32f95590a1ea7b9 2021-01-01 22:39:13 From: Bart Skowron <233652+bxsx@users.noreply.github.com> Date: 2021-01-01 22:39:13 Subject: [PATCH] Shorten identifier name to pass darker checks --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 7300b03..df1fe07 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -940,11 +940,11 @@ class InteractiveShell(SingletonConfigurable): p_ver = sys.version_info[:2] # Predict version from py[thon]-x.x in the $VIRTUAL_ENV - predicted_p_ver = re.search(r"\bpy(?:thon)?([23])\.(\d+)\b", os.environ["VIRTUAL_ENV"]) - if predicted_p_ver: - predicted_path = Path(str(virtual_env_path).format(*predicted_p_ver.groups())) + re_m = re.search(r"\bpy(?:thon)?([23])\.(\d+)\b", os.environ["VIRTUAL_ENV"]) + if re_m: + predicted_path = Path(str(virtual_env_path).format(*re_m.groups())) if predicted_path.exists(): - p_ver = predicted_p_ver.groups() + p_ver = re_m.groups() virtual_env = str(virtual_env_path).format(*p_ver)