From d258650ad4a6b0c9845c82e8c74170df337ade41 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 25 Jan 2021 12:47:07 -0800 Subject: [PATCH] use comparison with sys.platform so mypy understands it --- pre_commit/file_lock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pre_commit/file_lock.py b/pre_commit/file_lock.py index 5e7a0586..55a8eb29 100644 --- a/pre_commit/file_lock.py +++ b/pre_commit/file_lock.py @@ -1,11 +1,11 @@ import contextlib import errno -import os +import sys from typing import Callable from typing import Generator -if os.name == 'nt': # pragma: no cover (windows) +if sys.platform == 'win32': # pragma: no cover (windows) import msvcrt # https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/locking