ui: fix Python 2.7 support for ui.timestamp-output
authorJoerg Sonnenberger <joerg@bec.de>
Thu, 02 Jul 2020 19:54:44 +0200
changeset 45033 b4b6ff83ed9c
parent 45032 df3660cc60f5
child 45035 3862de62d5cf
ui: fix Python 2.7 support for ui.timestamp-output Differential Revision: https://phab.mercurial-scm.org/D8675
mercurial/ui.py
--- a/mercurial/ui.py	Wed Jul 01 14:28:12 2020 -0400
+++ b/mercurial/ui.py	Thu Jul 02 19:54:44 2020 +0200
@@ -1229,7 +1229,8 @@
         }
         if timestamp:
             args = (
-                b'[%s] ' % bytes(datetime.datetime.now().isoformat(), 'ASCII'),
+                b'[%s] '
+                % pycompat.bytestr(datetime.datetime.now().isoformat()),
             ) + args
         _writemsgwith(self._write, dest, *args, **opts)
         if timestamp: