MCPcopy Create free account
hub / github.com/METR/vivaria / run

Method run

pyhooks/pyhooks/python_server.py:132–142  ·  view source on GitHub ↗

Catch uncaught exceptions and save them to t.exc. Necessary to remove unwanted "Exception ignored in thread started by..." and "Exception ignored in sys.unraisablehook..." https://stackoverflow.com/a/31614591

(self)

Source from the content-addressed store, hash-verified

130 """
131
132 def run(self):
133 """
134 Catch uncaught exceptions and save them to t.exc.
135 Necessary to remove unwanted "Exception ignored in thread started by..." and "Exception ignored in sys.unraisablehook..."
136 https://stackoverflow.com/a/31614591
137 """
138 self.exc = None
139 try:
140 self.ret = self._target(*self._args, **self._kwargs) # type: ignore
141 except Exception as e:
142 self.exc = e
143
144 def raiseException(self, ExceptionClass):
145 """

Callers 4

mainMethod · 0.45
check_healthFunction · 0.45
execs.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected