From 9ada0723669f8427980ea4dc443f58f59e3fa4e3 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 24 Feb 2024 16:56:54 +0300 Subject: [PATCH] Style: Fix `flake8` error F821 undefined name 'error' --- xsetbg-wsgi.py | 3 +++ 1 file changed, 3 insertions(+) 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.") -- 2.39.5