Skip to content

Commit

Permalink
Upgrade flake8 to 3.7.9 (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
jd authored and zippolyte committed Nov 5, 2019
1 parent 6de7f51 commit d3e8be0
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion datadog/api/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def request(cls, method, url, headers, params, data, timeout, proxies, verify, m
pass
else:
raise _remove_context(HTTPError(e.response.status_code, result.reason))
except TypeError as e:
except TypeError:
raise TypeError(
u"Your installed version of `requests` library seems not compatible with"
u"Datadog's usage. We recommand upgrading it ('pip install -U requests')."
Expand Down
4 changes: 2 additions & 2 deletions datadog/dogshell/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _post(cls, args):
widgets = sys.stdin.read()
try:
widgets = json.loads(widgets)
except:
except Exception:
raise Exception('bad json parameter')

# Required arguments
Expand Down Expand Up @@ -117,7 +117,7 @@ def _update(cls, args):
widgets = sys.stdin.read()
try:
widgets = json.loads(widgets)
except:
except Exception:
raise Exception('bad json parameter')

# Required arguments
Expand Down
4 changes: 2 additions & 2 deletions datadog/dogshell/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _post(cls, args):
if args.options is not None:
try:
options = json.loads(args.options)
except:
except Exception:
raise Exception('bad json parameter')

if args.tags:
Expand Down Expand Up @@ -192,7 +192,7 @@ def _update(cls, args):
if args.options is not None:
try:
to_update['options'] = json.loads(args.options)
except:
except Exception:
raise Exception('bad json parameter')

res = api.Monitor.update(args.monitor_id, **to_update)
Expand Down
6 changes: 3 additions & 3 deletions datadog/dogshell/screenboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _post(cls, args):
graphs = sys.stdin.read()
try:
graphs = json.loads(graphs)
except:
except Exception:
raise Exception('bad json parameter')
res = api.Screenboard.create(
title=args.title, description=args.description, graphs=[graphs],
Expand All @@ -195,7 +195,7 @@ def _update(cls, args):
graphs = sys.stdin.read()
try:
graphs = json.loads(graphs)
except:
except Exception:
raise Exception('bad json parameter')

res = api.Screenboard.update(
Expand Down Expand Up @@ -271,7 +271,7 @@ def _new_file(cls, args):
graphs = sys.stdin.read()
try:
graphs = json.loads(graphs)
except:
except Exception:
raise Exception('bad json parameter')
res = api.Screenboard.create(board_title=args.filename,
description="Description for {0}".format(args.filename),
Expand Down
6 changes: 3 additions & 3 deletions datadog/dogshell/timeboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _new_file(cls, args):
graphs = sys.stdin.read()
try:
graphs = json.loads(graphs)
except:
except Exception:
raise Exception('bad json parameter')
res = api.Timeboard.create(
title=args.filename,
Expand Down Expand Up @@ -236,7 +236,7 @@ def _post(cls, args):
graphs = sys.stdin.read()
try:
graphs = json.loads(graphs)
except:
except Exception:
raise Exception('bad json parameter')
res = api.Timeboard.create(title=args.title, description=args.description, graphs=[graphs],
template_variables=args.template_variables)
Expand All @@ -256,7 +256,7 @@ def _update(cls, args):
graphs = sys.stdin.read()
try:
graphs = json.loads(graphs)
except:
except Exception:
raise Exception('bad json parameter')

res = api.Timeboard.update(args.timeboard_id, title=args.title,
Expand Down
8 changes: 4 additions & 4 deletions datadog/threadstats/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,10 @@ def flush():
try:
log.debug("Flushing metrics in thread")
self.flush()
except:
except Exception:
try:
log.exception("Error flushing in thread")
except:
except Exception:
pass

log.info("Starting flush thread with interval %s." % self.flush_interval)
Expand All @@ -427,10 +427,10 @@ def flush():
log.debug("Flushing metrics in greenlet")
self.flush()
gevent.sleep(self.flush_interval)
except:
except Exception:
try:
log.exception("Error flushing in greenlet")
except:
except Exception:
pass

log.info("Starting flush greenlet with interval %s." % self.flush_interval)
Expand Down
2 changes: 1 addition & 1 deletion datadog/util/hostname.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_ec2_instance_id():
finally:
# Reset the previous default timeout
socket.setdefaulttimeout(old_timeout)
except:
except Exception:
return socket.gethostname()


Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ commands =
[testenv:flake8]
skip_install = true
deps =
flake8==3.4.1
flake8==3.7.9
commands = flake8 datadog

[flake8]
Expand Down

0 comments on commit d3e8be0

Please sign in to comment.