From 0125b90c983f388f320b3e801069343f919f3c4e Mon Sep 17 00:00:00 2001 From: Dario Fagotto Date: Mon, 19 Jul 2021 01:15:17 +0200 Subject: [PATCH] Minimal changes to make it work with py3 with log and all --- patch.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/patch.py b/patch.py index 4775d70..58f70e9 100755 --- a/patch.py +++ b/patch.py @@ -62,6 +62,8 @@ def tostr(b): logger = logging.getLogger(__name__) +logger.handlers.clear() # really needed? maybe for use as library... + debug = logger.debug info = logger.info warning = logger.warning @@ -697,8 +699,8 @@ def _normalize_filenames(self): for i,p in enumerate(self.items): if debugmode: debug(" patch type = " + p.type) - debug(" source = " + p.source) - debug(" target = " + p.target) + debug(" source = " + tostr(p.source)) + debug(" target = " + tostr(p.target)) if p.type in (HG, GIT): # TODO: figure out how to deal with /dev/null entries debug("stripping a/ and b/ prefixes") @@ -1157,6 +1159,7 @@ def main(): loglevel = verbosity_levels[options.verbosity] logformat = "%(message)s" logger.setLevel(loglevel) + logger.addHandler(streamhandler) streamhandler.setFormatter(logging.Formatter(logformat)) if options.debugmode: