]> git.phdru.name Git - xsetbg.git/commitdiff
Style: Fix `flake8` error F821 undefined name 'error'
authorOleg Broytman <phd@phdru.name>
Sat, 24 Feb 2024 13:56:54 +0000 (16:56 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 24 Feb 2024 14:01:31 +0000 (17:01 +0300)
xsetbg-wsgi.py

index 161a2b5bd5bfaf3187cbc99e3c79a3e654da8e30..0b9e12dc4a90ba3f431dbf5a7711f68a67cd92ff 100755 (executable)
@@ -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.")