Skip to content

Commit 0527a27

Browse files
committed
Try to deal with this warning/error: DeprecationWarning: generator
'iter_roles' raised StopIteration PEP479 specifies how to rework it by using return rather than raise StopIteration. I am not sure if this is right, but test/test_cgi.py::FormTestCase::testRoles is still passing.
1 parent 65d6b91 commit 0527a27

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

roundup/hyperdb.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
logger = logging.getLogger('roundup.hyperdb')
3737

38-
3938
#
4039
# Types
4140
#
@@ -837,7 +836,7 @@ def iter_roles(roles):
837836
into something python can use more easily
838837
'''
839838
if not roles or not roles.strip():
840-
raise StopIteration("Empty roles given")
839+
return
841840
for role in [x.lower().strip() for x in roles.split(',')]:
842841
yield role
843842

0 commit comments

Comments
 (0)