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.
This commit is contained in:
Jiahao Liang 2017-02-08 23:26:37 -08:00 committed by GitHub
parent d5a6aa096c
commit 73cc575b66

View File

@ -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);