From 73cc575b6615dd97b74174f69ad14073153eecd4 Mon Sep 17 00:00:00 2001 From: Jiahao Liang Date: Wed, 8 Feb 2017 23:26:37 -0800 Subject: [PATCH] fix a bug while getQuotes()'s input is a unicode getQuotes() parses a single unicode symbol as a list. We should treat it as a single symbol. --- googlefinance/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlefinance/__init__.py b/googlefinance/__init__.py index f4193bb..ab03689 100644 --- a/googlefinance/__init__.py +++ b/googlefinance/__init__.py @@ -99,7 +99,7 @@ def getQuotes(symbols): :param symbols: a single symbol or a list of stock symbols :return: real-time quotes list ''' - if type(symbols) == type('str'): + if type(symbols) == type('str') or type(symbols) == type(u'unicode'): symbols = [symbols] content = json.loads(request(symbols)) return replaceKeys(content);