From 337b6f20db884f78389c064e21a45e4457ac62a5 Mon Sep 17 00:00:00 2001 From: Jonathan Reichelt Gjertsen Date: Sun, 8 Sep 2019 20:57:35 +0200 Subject: [PATCH] Bugfix: don't try to snoop on coroutines --- pysnooper/tracer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pysnooper/tracer.py b/pysnooper/tracer.py index 6d76685..f9625c3 100644 --- a/pysnooper/tracer.py +++ b/pysnooper/tracer.py @@ -234,6 +234,11 @@ class Tracer: def _wrap_class(self, cls): for attr_name, attr in cls.__dict__.items(): + # Coroutines are functions, but snooping them is not supported + # at the moment + if pycompat.iscoroutinefunction(attr): + continue + if inspect.isfunction(attr): setattr(cls, attr_name, self._wrap_function(attr)) return cls