Commit 3351aa7d authored by Collin Winter's avatar Collin Winter

Convert an assert to a raise so it works even in the presence of -O.

parent 74780961
......@@ -81,10 +81,12 @@ class ServerThread(threading.Thread):
svr = svrcls(self.__addr, self.__hdlrcls)
# pull the address out of the server in case it changed
# this can happen if another process is using the port
addr = getattr(svr, 'server_address')
addr = svr.server_address
if addr:
self.__addr = addr
assert self.__addr == svr.socket.getsockname()
if self.__addr != svr.socket.getsockname():
raise RuntimeError('server_address was %s, expected %s' %
(self.__addr, svr.socket.getsockname()))
if verbose: print "thread: serving three times"
svr.serve_a_few()
if verbose: print "thread: done"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment