fix: linter fixes and added python 3.9 to tests

This commit is contained in:
Kamil Gałuszka
2020-10-15 01:05:40 +02:00
parent d0e7fa7cca
commit 32eff19bb6
3 changed files with 5 additions and 5 deletions

View File

@@ -1,10 +1,10 @@
sudo: false sudo: false
language: python language: python
python: python:
- "3.5"
- "3.6" - "3.6"
- "3.7" - "3.7"
- "3.8" - "3.8"
- "3.9"
cache: cache:
directories: directories:

View File

@@ -158,8 +158,8 @@ def run_process(command, environ):
env.update(environ) env.update(environ)
try: try:
p = subprocess.Popen(args=command, env=env) p = subprocess.Popen(args=command, env=env)
except OSError as e: except OSError as exc:
raise OSError('cannot run %r: %s' % (command, e)) raise OSError('cannot run %r: %s' % (command, exc)) from exc
log.debug('subprocess %d is running', p.pid) log.debug('subprocess %d is running', p.pid)
ret = p.wait() ret = p.wait()
log.debug('subprocess %d exited: %d', p.pid, ret) log.debug('subprocess %d exited: %d', p.pid, ret)

View File

@@ -149,9 +149,9 @@ class Handler:
try: try:
sig_bytes = key['verifier'](sig=signature, msg=blob) sig_bytes = key['verifier'](sig=signature, msg=blob)
log.info('signature status: OK') log.info('signature status: OK')
except formats.ecdsa.BadSignatureError: except formats.ecdsa.BadSignatureError as exc:
log.exception('signature status: ERROR') log.exception('signature status: ERROR')
raise ValueError('invalid ECDSA signature') raise ValueError('invalid ECDSA signature') from exc
log.debug('signature size: %d bytes', len(sig_bytes)) log.debug('signature size: %d bytes', len(sig_bytes))