Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not used, shadows built-in variables #996

Merged
merged 1 commit into from Dec 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions raiden/accounts.py
Expand Up @@ -16,8 +16,6 @@ def find_datadir():
home = os.path.expanduser('~')
if home == '~': # Could not expand user path
return None
datadir = None

if sys.platform == 'darwin':
datadir = os.path.join(home, 'Library', 'Ethereum')
# NOTE: Not really sure about cygwin here
Expand Down
10 changes: 5 additions & 5 deletions raiden/api/rest.py
Expand Up @@ -223,19 +223,19 @@ def __init__(self, rest_api, cors_domain_list=None, web_ui=False, eth_rpc_endpoi
methods=('GET', ),
)

def _serve_webui(self, file='index.html'): # pylint: disable=redefined-builtin
def _serve_webui(self, file_name='index.html'): # pylint: disable=redefined-builtin
try:
assert file
assert file_name
web3 = self.flask_app.config.get('WEB3_ENDPOINT')
if web3 and 'config.' in file and file.endswith('.json'):
if web3 and 'config.' in file_name and file_name.endswith('.json'):
host = request.headers.get('Host')
if any(h in web3 for h in ('localhost', '127.0.0.1')) and host:
_, _port = split_endpoint(web3)
_host, _ = split_endpoint(host)
web3 = 'http://{}:{}'.format(_host, _port)
response = jsonify({'raiden': self._api_prefix, 'web3': web3})
else:
response = send_from_directory(self.flask_app.config['WEBUI_PATH'], file)
response = send_from_directory(self.flask_app.config['WEBUI_PATH'], file_name)
except (NotFound, AssertionError):
response = send_from_directory(self.flask_app.config['WEBUI_PATH'], 'index.html')
return response
Expand Down Expand Up @@ -485,7 +485,7 @@ def initiate_transfer(self, token_address, target_address, amount, identifier):
errors=str(e),
status_code=http.client.CONFLICT
)
except (InsufficientFunds) as e:
except InsufficientFunds as e:
return api_error(
errors=str(e),
status_code=http.client.PAYMENT_REQUIRED
Expand Down