diff mercurial/templatefilters.py @ 52678:b3e68fd7864b

pyupgrade: primitive types directly where possible This was rewritten by the `type_of_primitive` fixer in `pyupgrade`. Interesting that 9db77d46de79 missed a bunch of these `u''` prefixes.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 06 Jan 2025 01:39:53 -0500
parents ab7b4fba8bde
children
line wrap: on
line diff
--- a/mercurial/templatefilters.py	Mon Jan 06 01:37:43 2025 -0500
+++ b/mercurial/templatefilters.py	Mon Jan 06 01:39:53 2025 -0500
@@ -336,7 +336,7 @@
         return pycompat.bytestr(obj)
     elif isinstance(obj, bytes):
         return b'"%s"' % encoding.jsonescape(obj, paranoid=paranoid)
-    elif isinstance(obj, type(u'')):
+    elif isinstance(obj, str):
         raise error.ProgrammingError(
             b'Mercurial only does output with bytes: %r' % obj
         )