from easyquotation.sina import Sina


class SinaWithTimeoutPatch(Sina):
    """ 新浪数据源带超时时间补丁 """
    
    def get_stocks_by_range(self, params):
        """ Hook 获取股票数据 """
        headers = self._get_headers()
        r = self._session.get(self.stock_api + params, headers=headers, timeout=5)
        return r.text
