Skip to content

Commit ad80273

Browse files
committed
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.
1 parent 6d5c217 commit ad80273

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

roundup/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,12 +877,13 @@ def do_get(self, args):
877877

878878
# get the class
879879
cl = self.get_class(classname)
880-
prop_obj = properties[propname]
881880
try:
882881
if not (self.separator or self.print_designator):
883882
print(cl.get(nodeid, propname))
884883
continue
885884

885+
properties = cl.getprops()
886+
prop_obj = properties[propname]
886887
if not (isinstance(prop_obj,
887888
(hyperdb.Link, hyperdb.Multilink))):
888889
raise UsageError(_(

roundup/anypy/strings.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def s2u(s, errors='strict'):
4848
if _py3:
4949
return s
5050
else:
51-
return unicode(s, 'utf-8', errors) # noqa: 821
51+
return unicode(s, 'utf-8', errors) # noqa: F821
5252

5353

5454
def u2s(u):
@@ -64,18 +64,18 @@ def us2u(s, errors='strict'):
6464
if _py3:
6565
return s
6666
else:
67-
if isinstance(s, unicode): # noqa: 821
67+
if isinstance(s, unicode): # noqa: F821
6868
return s
6969
else:
70-
return unicode(s, 'utf-8', errors) # noqa: 821
70+
return unicode(s, 'utf-8', errors) # noqa: F821
7171

7272

7373
def us2s(u):
7474
"""Convert a string or Unicode string to the internal string format."""
7575
if _py3:
7676
return u
7777
else:
78-
if isinstance(u, unicode): # noqa: 821
78+
if isinstance(u, unicode): # noqa: F821
7979
return u.encode('utf-8')
8080
else:
8181
return u
@@ -88,7 +88,7 @@ def uany2s(u):
8888
if _py3:
8989
return str(u)
9090
else:
91-
if isinstance(u, unicode): # noqa: 821
91+
if isinstance(u, unicode): # noqa: F821
9292
return u.encode('utf-8')
9393
else:
9494
return str(u)
@@ -99,15 +99,15 @@ def is_us(s):
9999
if _py3:
100100
return isinstance(s, str)
101101
else:
102-
return isinstance(s, str) or isinstance(s, unicode) # noqa: 821
102+
return isinstance(s, str) or isinstance(s, unicode) # noqa: F821
103103

104104

105105
def uchr(c):
106106
"""Return the Unicode string containing the given character."""
107107
if _py3:
108108
return chr(c)
109109
else:
110-
return unichr(c) # noqa: 821
110+
return unichr(c) # noqa: F821
111111

112112
# CSV files used for export and import represent strings in the style
113113
# used by repr in Python 2; this means that each byte of the UTF-8

0 commit comments

Comments
 (0)