Blob Blame History Raw
diff --git a/q.py b/q.py
index 1bf76d0..fcff4c9 100644
--- a/q.py
+++ b/q.py
@@ -294,8 +294,9 @@ def __call__(self, *args):
             lines = info.code_context[:info.index + 1]
 
         # If we see "@q" on a single line, behave like a trace decorator.
-        if lines[-1].strip().startswith('@') and args:
-            return self.trace(args[0])
+        for line in lines:
+            if line.strip() in ('@q', '@q()') and args:
+                return self.trace(args[0])
 
         # Otherwise, search for the beginning of the call expression; once it
         # parses, use the expressions in the call to label the debugging output.