Browse Source

remove two more assert statements with side-effects

- these were overlooked in e7d531db0
- scripts now run with PYTHONOPTIMIZE=1, though this should never be set
  in a production environment
The MMGen Project 3 years ago
parent
commit
3fa644b35b
2 changed files with 4 additions and 2 deletions
  1. 2 1
      mmgen/addrfile.py
  2. 2 1
      test/misc/oneshot_warning.py

+ 2 - 1
mmgen/addrfile.py

@@ -230,7 +230,8 @@ class AddrFile(MMGenObject):
 			assert len(lines) >= 3, f'Too few lines in address file ({len(lines)})'
 			ls = lines[0].split()
 			assert 1 < len(ls) < 5, f'Invalid first line for {p.gen_desc} file: {lines[0]!r}'
-			assert ls.pop() == '{', f'{ls!r}: invalid first line'
+			assert ls[-1] == '{', f'{ls!r}: invalid first line'
+			ls.pop()
 			assert lines[-1] == '}', f'{lines[-1]!r}: invalid last line'
 			sid = ls.pop(0)
 			assert is_seed_id(sid), f'{sid!r}: invalid Seed ID'

+ 2 - 1
test/misc/oneshot_warning.py

@@ -32,7 +32,8 @@ for i in (1,2,3):
 
 	msg('\npw')
 	for k in ('A','B'):
-		assert pwfile_reuse_warning(k).warning_shown == (i != 1), 'warning_shown incorrect'
+		ret = pwfile_reuse_warning(k).warning_shown
+		assert ret == (i != 1), 'warning_shown incorrect'
 
 	msg('wg1')
 	wg('foo')