diff roundup/anypy/strings.py @ 7755:417c8ddc98ac

fix: undo last minute edit and try to get make checkin clean. Fixed admin.py. Change # noqa: 821 to # noqa: F821 to make ruff ignore undefined variable in the python 2 branch of the code. Hopefully the flake8 run in CI will accept the change from 821 to F821 and not error with an undefined variable.
author John Rouillard <rouilj@ieee.org>
date Fri, 01 Mar 2024 15:42:24 -0500
parents 8e118eb20d86
children c65e0a725c88
line wrap: on
line diff
--- a/roundup/anypy/strings.py	Fri Mar 01 15:13:36 2024 -0500
+++ b/roundup/anypy/strings.py	Fri Mar 01 15:42:24 2024 -0500
@@ -48,7 +48,7 @@
     if _py3:
         return s
     else:
-        return unicode(s, 'utf-8', errors)  # noqa: 821
+        return unicode(s, 'utf-8', errors)  # noqa: F821
 
 
 def u2s(u):
@@ -64,10 +64,10 @@
     if _py3:
         return s
     else:
-        if isinstance(s, unicode):    # noqa: 821
+        if isinstance(s, unicode):    # noqa: F821
             return s
         else:
-            return unicode(s, 'utf-8', errors)    # noqa: 821
+            return unicode(s, 'utf-8', errors)    # noqa: F821
 
 
 def us2s(u):
@@ -75,7 +75,7 @@
     if _py3:
         return u
     else:
-        if isinstance(u, unicode):    # noqa: 821
+        if isinstance(u, unicode):    # noqa: F821
             return u.encode('utf-8')
         else:
             return u
@@ -88,7 +88,7 @@
     if _py3:
         return str(u)
     else:
-        if isinstance(u, unicode):    # noqa: 821
+        if isinstance(u, unicode):    # noqa: F821
             return u.encode('utf-8')
         else:
             return str(u)
@@ -99,7 +99,7 @@
     if _py3:
         return isinstance(s, str)
     else:
-        return isinstance(s, str) or isinstance(s, unicode)  # noqa: 821
+        return isinstance(s, str) or isinstance(s, unicode)  # noqa: F821
 
 
 def uchr(c):
@@ -107,7 +107,7 @@
     if _py3:
         return chr(c)
     else:
-        return unichr(c)  # noqa: 821
+        return unichr(c)  # noqa: F821
 
 # CSV files used for export and import represent strings in the style
 # used by repr in Python 2; this means that each byte of the UTF-8

Roundup Issue Tracker: http://roundup-tracker.org/