Skip to content

Commit

Permalink
chore(lint): _ unused var; replace assert wth if/raise; whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
rouilj committed Mar 24, 2024
1 parent bbad7fe commit f075e97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions roundup/cgi/wsgi_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'a given amount of time ("rate limiting")',
)


class Headers(object):
""" Idea more or less stolen from the 'apache.py' in same directory.
Except that wsgi stores http headers in environment.
Expand Down Expand Up @@ -68,7 +69,7 @@ def __init__(self, environ, start_response):

def start_response(self, headers, response_code):
"""Set HTTP response code"""
message, explain = BaseHTTPRequestHandler.responses[response_code]
message, _explain = BaseHTTPRequestHandler.responses[response_code]
self.__wfile = self.__start_response('%d %s' % (response_code,
message), headers)

Expand All @@ -81,7 +82,8 @@ def get_wfile(self):
class RequestDispatcher(object):
def __init__(self, home, debug=False, timing=False, lang=None,
feature_flags=None):
assert os.path.isdir(home), '%r is not a directory' % (home,)
if not os.path.isdir(home):
raise ValueError('%r is not a directory' % (home,))
self.home = home
self.debug = debug
self.timing = timing
Expand Down

0 comments on commit f075e97

Please sign in to comment.