Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Fix flake8 complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
aermakov-zalando committed Feb 13, 2018
1 parent b56efa4 commit 07f2d47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions piu/cli.py
Expand Up @@ -26,7 +26,7 @@

try:
import pyperclip
except:
except ImportError:
pyperclip = None


Expand Down Expand Up @@ -113,10 +113,9 @@ def resolve_command(self, ctx, args):
def load_config(path):
try:
with open(path, 'rb') as fd:
config = yaml.safe_load(fd)
except:
config = None
return config or {}
return yaml.safe_load(fd)
except Exception:
return {}


def store_config(config, path):
Expand Down Expand Up @@ -272,7 +271,7 @@ def request_access(config_file, host, reason, reason_cont, even_url, odd_host, l
even_url = 'https://{}'.format(even_url)
try:
requests.get(even_url)
except:
except Exception:
error('Could not reach {}'.format(even_url))
even_url = None
config['even_url'] = even_url
Expand All @@ -281,7 +280,7 @@ def request_access(config_file, host, reason, reason_cont, even_url, odd_host, l
odd_host = click.prompt('Please enter the Odd SSH bastion hostname')
try:
socket.getaddrinfo(odd_host, 22)
except:
except Exception:
error('Could not resolve hostname {}'.format(odd_host))
odd_host = None
config['odd_host'] = odd_host
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -79,7 +79,7 @@ def finalize_options(self):
def run_tests(self):
try:
import pytest
except:
except ImportError:
raise RuntimeError('py.test is not installed, run: pip install pytest')
params = {'args': self.test_args}
if self.cov:
Expand Down

0 comments on commit 07f2d47

Please sign in to comment.