From f9caa2555ad91cd39fd66e0a7b68131a0be79107 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Mon, 8 Aug 2016 19:40:40 -0400 Subject: [PATCH] HTMLParser is old-style in python 2? --- metrik/tasks/bloomberg.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/metrik/tasks/bloomberg.py b/metrik/tasks/bloomberg.py index 89aa271..9e79d27 100644 --- a/metrik/tasks/bloomberg.py +++ b/metrik/tasks/bloomberg.py @@ -22,7 +22,13 @@ class BloombergEquityInfo(Task): class EquityInfoParser(HTMLParser): def __init__(self, keys): - super(EquityInfoParser, self).__init__() + # This call isn't safe because python 2 HTMLParser is an + # old-style class + try: + super(EquityInfoParser, self).__init__() + except TypeError: + pass + self.keys = keys self.records = {k: None for k in keys} self.do_record = {k: False for k in keys}