From 61953f13dab965722315f97c4bcef1a54c41c98c Mon Sep 17 00:00:00 2001 From: Florian Perucki Date: Thu, 11 Feb 2016 18:28:08 +0100 Subject: [PATCH] Fixed error when accessing 'spec' attribute on _GetMore queries --- mrq/monkey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mrq/monkey.py b/mrq/monkey.py index b203863a..f60f5213 100644 --- a/mrq/monkey.py +++ b/mrq/monkey.py @@ -410,7 +410,7 @@ def _Cursor__send_message(self, *args, **kwargs): config.get("mongodb_pre_hook")({ "collection": full_name, "method": subtype, - "args": (args[0].spec, ), + "args": (getattr(args[0], "spec", None), ), "kwargs": kwargs, "client": self._Cursor__collection.database.client, "job": job @@ -429,7 +429,7 @@ def _Cursor__send_message(self, *args, **kwargs): config.get("mongodb_post_hook")({ "collection": full_name, "method": subtype, - "args": (args[0].spec, ), + "args": (getattr(args[0], "spec", None), ), "kwargs": kwargs, "client": self._Cursor__collection.database.client, "job": job,