changeset 45037:b4b6ff83ed9c

ui: fix Python 2.7 support for ui.timestamp-output Differential Revision: https://phab.mercurial-scm.org/D8675
author Joerg Sonnenberger <joerg@bec.de>
date Thu, 02 Jul 2020 19:54:44 +0200
parents df3660cc60f5
children 3862de62d5cf
files mercurial/ui.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: