Catch the throw exception in variable e

The next line refers to __e__ twice but it is never defined.


flake8 testing of https://github.com/Aidaho12/haproxy-wi on Python 3.6.3

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./app/delver.py:58:36: F821 undefined name 'e'
					stderr = "Error: %s - %s." % (e.filename,e.strerror)
                                   ^
./app/delver.py:58:47: F821 undefined name 'e'
					stderr = "Error: %s - %s." % (e.filename,e.strerror)
                                              ^
2     F821 undefined name 'e'
2
```
pull/20/head
cclauss 6 years ago committed by GitHub
parent c8914a3f12
commit 038619f972
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -54,7 +54,7 @@ if serv is not None and form.getvalue('open') is not None:
os.remove(os.path.join(hap_configs_dir, form.getvalue(get))) os.remove(os.path.join(hap_configs_dir, form.getvalue(get)))
file.add(form.getvalue(get) + "<br />") file.add(form.getvalue(get) + "<br />")
funct.logging(serv, "delver.py deleted config: %s" % form.getvalue(get)) funct.logging(serv, "delver.py deleted config: %s" % form.getvalue(get))
except OSError: except OSError as e:
stderr = "Error: %s - %s." % (e.filename,e.strerror) stderr = "Error: %s - %s." % (e.filename,e.strerror)
print('<meta http-equiv="refresh" content="10; url=delver.py?serv=%s&open=open">' % form.getvalue('serv')) print('<meta http-equiv="refresh" content="10; url=delver.py?serv=%s&open=open">' % form.getvalue('serv'))
@ -72,4 +72,4 @@ output_from_parsed_template = template.render(h2 = 1, title = "Delete old versio
Select = form.getvalue('del'), Select = form.getvalue('del'),
file = file, file = file,
token = token) token = token)
print(output_from_parsed_template) print(output_from_parsed_template)

Loading…
Cancel
Save