From 1c7c15aca27999e8b0733798a1e376ca773ba495 Mon Sep 17 00:00:00 2001 From: Mahmoud Hashemi Date: Mon, 24 Feb 2014 20:43:24 -0800 Subject: [PATCH] fix object header guessing --- boltons/tableutils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/boltons/tableutils.py b/boltons/tableutils.py index 7a813a0..075d179 100644 --- a/boltons/tableutils.py +++ b/boltons/tableutils.py @@ -117,7 +117,12 @@ class ObjectInputType(InputType): headers = [] for attr in dir(obj): # an object's __dict__ could have non-string keys but meh - val = getattr(obj, attr) + try: + val = getattr(obj, attr) + except: + # seen on greenlet: `run` shows in dir() but raises + # AttributeError. Also properties misbehave. + continue if callable(val): continue headers.append(attr)