From db201c7e8329ebc584fbebcc18f5b64825f6d023 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 12 Aug 2021 14:03:24 +0200 Subject: Adding upstream version 2.14.0. Signed-off-by: Daniel Baumann --- pre_commit/commands/install_uninstall.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'pre_commit/commands/install_uninstall.py') diff --git a/pre_commit/commands/install_uninstall.py b/pre_commit/commands/install_uninstall.py index 684b598..73c8d60 100644 --- a/pre_commit/commands/install_uninstall.py +++ b/pre_commit/commands/install_uninstall.py @@ -21,13 +21,13 @@ logger = logging.getLogger(__name__) # This is used to identify the hook file we install PRIOR_HASHES = ( - '4d9958c90bc262f47553e2c073f14cfe', - 'd8ee923c46731b42cd95cc869add4062', - '49fd668cb42069aa1b6048464be5d395', - '79f09a650522a87b0da915d0d983b2de', - 'e358c9dae00eac5d06b38dfdb1e33a8c', + b'4d9958c90bc262f47553e2c073f14cfe', + b'd8ee923c46731b42cd95cc869add4062', + b'49fd668cb42069aa1b6048464be5d395', + b'79f09a650522a87b0da915d0d983b2de', + b'e358c9dae00eac5d06b38dfdb1e33a8c', ) -CURRENT_HASH = '138fd403232d2ddd5efb44317e38bf03' +CURRENT_HASH = b'138fd403232d2ddd5efb44317e38bf03' TEMPLATE_START = '# start templated\n' TEMPLATE_END = '# end templated\n' # Homebrew/homebrew-core#35825: be more timid about appropriate `PATH` @@ -48,7 +48,7 @@ def _hook_paths( def is_our_script(filename: str) -> bool: if not os.path.exists(filename): # pragma: win32 no cover (symlink) return False - with open(filename) as f: + with open(filename, 'rb') as f: contents = f.read() return any(h in contents for h in (CURRENT_HASH,) + PRIOR_HASHES) -- cgit v1.2.3