summary refs log tree commit diff
path: root/synmark
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--synmark/__init__.py4
-rw-r--r--synmark/__main__.py6
2 files changed, 8 insertions, 2 deletions
diff --git a/synmark/__init__.py b/synmark/__init__.py

index 8c47e50c7c..887fec2f96 100644 --- a/synmark/__init__.py +++ b/synmark/__init__.py
@@ -27,7 +27,9 @@ from synapse.types import ISynapseReactor try: from twisted.internet.epollreactor import EPollReactor as Reactor except ImportError: - from twisted.internet.pollreactor import PollReactor as Reactor # type: ignore[assignment] + from twisted.internet.pollreactor import ( # type: ignore[assignment] + PollReactor as Reactor, + ) from twisted.internet.main import installReactor diff --git a/synmark/__main__.py b/synmark/__main__.py
index cac57cf111..4944c2f3b0 100644 --- a/synmark/__main__.py +++ b/synmark/__main__.py
@@ -40,7 +40,7 @@ T = TypeVar("T") def make_test( - main: Callable[[ISynapseReactor, int], Coroutine[Any, Any, float]] + main: Callable[[ISynapseReactor, int], Coroutine[Any, Any, float]], ) -> Callable[[int], float]: """ Take a benchmark function and wrap it in a reactor start and stop. @@ -90,6 +90,10 @@ if __name__ == "__main__": if runner.args.worker: if runner.args.log: + # sys.__stdout__ can technically be None, just exit if it's the case + if not sys.__stdout__: + exit(1) + globalLogBeginner.beginLoggingTo( [textFileLogObserver(sys.__stdout__)], redirectStandardIO=False )