Skip to content

Commit baacc4a

Browse files
fix: move server_port assignment inside try block
Fixes AttributeError by ensuring server_port is accessed only after successful HTTPServer creation
1 parent b3e38a5 commit baacc4a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ggshield/verticals/auth/oauth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def _prepare_server(self) -> None:
164164
functools.partial(RequestHandler, self),
165165
)
166166
self._port = self.server.server_port # Get the assigned port
167+
167168
except OSError as e:
168169
raise UnexpectedError(f"Could not create local server: {e}")
169170

0 commit comments

Comments
 (0)