diff mercurial/encoding.py @ 52646:cb769c0ffe35

pyupgrade: drop a usage of `typing.Text` This is the `typing_text` fixer in `pyupgrade`. This type was meant to be for py2/py3 interoperability, being bytes on py2 and str on py3.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 06 Jan 2025 00:38:32 -0500
parents 5cc8deb96b48
children
line wrap: on
line diff
--- a/mercurial/encoding.py	Mon Jan 06 00:30:55 2025 -0500
+++ b/mercurial/encoding.py	Mon Jan 06 00:38:32 2025 -0500
@@ -16,7 +16,6 @@
 from typing import (
     Any,
     Callable,
-    Text,
     TypeVar,
 )
 
@@ -386,7 +385,7 @@
     return ucolwidth(s.decode(_sysstr(encoding), 'replace'))
 
 
-def ucolwidth(d: Text) -> int:
+def ucolwidth(d: str) -> int:
     """Find the column width of a Unicode string for display"""
     eaw = getattr(unicodedata, 'east_asian_width', None)
     if eaw is not None: