From 4c6d68dd2e460095e20ba32007a35da4c5e6dae6 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 26 Sep 2017 22:50:27 +0200 Subject: Fix more PEP-8 violations --- opendc/util/rest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'opendc/util/rest.py') diff --git a/opendc/util/rest.py b/opendc/util/rest.py index 7cf2d0b3..85da4eaa 100644 --- a/opendc/util/rest.py +++ b/opendc/util/rest.py @@ -6,8 +6,8 @@ from oauth2client import client, crypt from opendc.util import exceptions, parameter_checker -with open(sys.argv[1]) as file: - KEYS = json.load(file) +with open(sys.argv[1]) as f: + KEYS = json.load(f) class Request(object): @@ -48,7 +48,7 @@ class Request(object): self.module = importlib.import_module(module_base.format(module_path)) - except UnicodeError as e: + except UnicodeError: raise exceptions.UnimplementedEndpointError('Non-ASCII path') except ImportError: @@ -58,7 +58,7 @@ class Request(object): # Check the method - if not self.method in ['POST', 'GET', 'PUT', 'PATCH', 'DELETE']: + if self.method not in ['POST', 'GET', 'PUT', 'PATCH', 'DELETE']: raise exceptions.UnsupportedMethodError('Non-rest method: {}'.format(self.method)) if not hasattr(self.module, self.method): -- cgit v1.2.3