comparison roundup/admin.py @ 5245:bc16d91b7a50

Fix token_split() so its one error throws ValueError w/out extra arg. In Python 3, raise has to throw a single object value without extra arguments. This commit also checked the function's callsites. One needed armoring, didn't have it, and got it. There didn't seem to be anything to do about the other than add a warning comment. All tests pass.
author Eric S. Raymond <esr@thyrsus.com>
date Thu, 24 Aug 2017 17:27:49 -0400
parents 462b0f76fce8
children 198b6e810c67
comparison
equal deleted inserted replaced
5244:09235a01250a 5245:bc16d91b7a50
1553 command = raw_input(_('roundup> ')) 1553 command = raw_input(_('roundup> '))
1554 except EOFError: 1554 except EOFError:
1555 print _('exit...') 1555 print _('exit...')
1556 break 1556 break
1557 if not command: continue 1557 if not command: continue
1558 args = token.token_split(command) 1558 try:
1559 args = token.token_split(command)
1560 except ValueError:
1561 continue # Ignore invalid quoted token
1559 if not args: continue 1562 if not args: continue
1560 if args[0] in ('quit', 'exit'): break 1563 if args[0] in ('quit', 'exit'): break
1561 self.run_command(args) 1564 self.run_command(args)
1562 1565
1563 # exit.. check for transactions 1566 # exit.. check for transactions

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