From 49fea2520f5c672493a91be8c0e3bb4ef6de6e27 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 11 Nov 2019 12:41:23 +0100 Subject: python: Avoid using 'is' to compare strings This is the wrong operator to use, which only seems to work because `os.name` and `'nt'` happen to be the same object. Python 3.8 also produces a `SyntaxWarning` when encountering this pattern. --- scripts/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/common.py b/scripts/common.py index 4fea527359..f9c19850d2 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -11,7 +11,7 @@ import uuid ROOTDIR = os.path.abspath(os.path.dirname(__file__)) -if os.name is 'nt': +if os.name == 'nt': import ctypes from ctypes import wintypes _GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW -- cgit v1.2.1