From b3c86013ab33db9fc479f5b061d1e4a770608c80 Mon Sep 17 00:00:00 2001 From: Ralesk Date: Mon, 7 Sep 2020 13:26:23 +0200 Subject: [PATCH] Make python hooks compatible with py3 --- src/utils/get-hook-script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/get-hook-script.js b/src/utils/get-hook-script.js index 52743a981..db2e2af2e 100644 --- a/src/utils/get-hook-script.js +++ b/src/utils/get-hook-script.js @@ -149,6 +149,7 @@ function createHgScript(normalizedPath, hookName, npmScriptName, verifyMessage) ` #!/usr/bin/python #husky ${pkg.version} + from __future__ import print_function import os import sys import re @@ -157,10 +158,10 @@ function createHgScript(normalizedPath, hookName, npmScriptName, verifyMessage) pfx = 'husky > ' def print_msg(msg): - print pfx + msg + print(pfx + msg) def print_error_msg(msg): - print >> sys.stderr, pfx + msg + print(pfx + msg, file=sys.stderr) def has_cmd(cmd): def is_exe(fp):