Skip to content

Commit

Permalink
Prevent UnboundLocalError
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Oct 31, 2024
1 parent bdc7c7d commit 4ae0566
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/unoserver/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ def serve(self):
self.xmlrcp_server = server
server.register_introspection_functions()

number_of_requests = 0
self.number_of_requests = 0

def stop_after():
if self.stop_after is None:
return
number_of_requests += 1
if number_of_requests == self.stop_after:
self.number_of_requests += 1
if self.number_of_requests == self.stop_after:
logger.info(
"Processed %d requests, exiting.",
self.stop_after,
Expand Down

0 comments on commit 4ae0566

Please sign in to comment.