From: Oleg Broytman Date: Sat, 24 Feb 2024 13:56:54 +0000 (+0300) Subject: Style: Fix `flake8` error F821 undefined name 'error' X-Git-Tag: 5.1.0~6 X-Git-Url: https://git.phdru.name/?p=xsetbg.git;a=commitdiff_plain;h=9ada0723669f8427980ea4dc443f58f59e3fa4e3 Style: Fix `flake8` error F821 undefined name 'error' --- diff --git a/xsetbg-wsgi.py b/xsetbg-wsgi.py index 161a2b5..0b9e12d 100755 --- a/xsetbg-wsgi.py +++ b/xsetbg-wsgi.py @@ -3,6 +3,7 @@ """ +import sys from wsgiref import simple_server from wsgiref.handlers import SimpleHandler from wsgiref.simple_server import WSGIServer, make_server @@ -21,6 +22,8 @@ else: if xsetbg_conf.has_option("httpd", "port"): port = xsetbg_conf.getint("httpd", "port") else: + def error(error_str): + sys.exit("%s: Error: %s\n" % (sys.argv[0], error_str)) error("Config must specify a port to listen. Abort.")