Skip to content

Commit

Permalink
Update to Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminPelletier committed Nov 24, 2023
1 parent b32d925 commit 2d6b4dc
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 25 deletions.
2 changes: 1 addition & 1 deletion monitoring/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# This image is intended to be built from the repository root context/folder.

FROM python:3.8-slim
FROM python:3.11-slim
# Not -alpine because: https://stackoverflow.com/a/58028091/651139

RUN apt-get update && apt-get install -y openssl curl libgeos-dev gcc && apt-get install ca-certificates
Expand Down
4 changes: 1 addition & 3 deletions monitoring/mock_uss/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def from_exception(trigger: str, e: BaseException):
trigger=trigger,
type=type(e).__name__,
message=str(e),
stacktrace="".join(
traceback.format_exception(etype=type(e), value=e, tb=e.__traceback__)
),
stacktrace="".join(traceback.format_exception(e)),
)


Expand Down
4 changes: 1 addition & 3 deletions monitoring/mock_uss/scd_injection/routes_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@


def _make_stacktrace(e) -> str:
return "".join(
traceback.format_exception(etype=type(e), value=e, tb=e.__traceback__)
)
return "".join(traceback.format_exception(e))


@webapp.route("/scdsc/v1/status", methods=["GET"])
Expand Down
4 changes: 1 addition & 3 deletions monitoring/mock_uss/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@


def _get_trace(e: Exception) -> str:
return "".join(
traceback.format_exception(etype=type(e), value=e, tb=e.__traceback__)
)
return "".join(traceback.format_exception(e))


class TaskTrigger(str, Enum):
Expand Down
6 changes: 1 addition & 5 deletions monitoring/monitorlib/fetch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,7 @@ def __init__(self, msg: str, queries: Optional[Union[Query, List[Query]]] = None

@property
def stacktrace(self) -> str:
return "".join(
traceback.format_exception(
etype=QueryError, value=self, tb=self.__traceback__
)
)
return "".join(traceback.format_exception(self))


yaml.add_representer(Query, Representer.represent_dict)
Expand Down
2 changes: 1 addition & 1 deletion monitoring/monitorlib/multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(
"""
self._lock = multiprocessing.RLock()
self._shared_memory = multiprocessing.shared_memory.SharedMemory(
create=True, size=capacity_bytes + self.SIZE_BYTES
create=True, size=int(capacity_bytes + self.SIZE_BYTES)
)
self._encoder = (
encoder
Expand Down
4 changes: 1 addition & 3 deletions monitoring/uss_qualifier/reports/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ def create_from_exception(e: Exception):
type=str(inspection.fullname(e.__class__)),
message=str(e),
timestamp=StringBasedDateTime(datetime.utcnow()),
stacktrace="".join(
traceback.format_exception(type(e), value=e, tb=e.__traceback__)
),
stacktrace="".join(traceback.format_exception(e)),
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ def cleanup(self):
)
check.record_passed()
except (RequestException, ValueError) as e:
stacktrace = "".join(
traceback.format_exception(type(e), value=e, tb=e.__traceback__)
)
stacktrace = "".join(traceback.format_exception(e))
check.record_failed(
summary="Error while trying to delete test flight",
severity=Severity.Medium,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ def cleanup(self):
)
check.record_passed()
except (RequestException, ValueError) as e:
stacktrace = "".join(
traceback.format_exception(type(e), value=e, tb=e.__traceback__)
)
stacktrace = "".join(traceback.format_exception(e))
check.record_failed(
summary="Error while trying to delete test flight",
severity=Severity.Medium,
Expand Down

0 comments on commit 2d6b4dc

Please sign in to comment.