使用时的SyntaxError除了在Python中

时间:2015-06-24 14:37:24

标签: python

我在下面的代码中出于某种原因在行SyntaxError: invalid syntax中收到错误except httplib.IncompleteRead, e:。它的Python 3.4

import httplib
import xlrd
import urllib

try:
    url = 'http://www.bankofcanada.ca/stats/results/xls'

#In case of http.client.IncompleteRead Error
except httplib.IncompleteRead, e:
    spot_curve = e.partial
    short_end_spot_curve = e.partial 

1 个答案:

答案 0 :(得分:1)

至少在Python3中它是:

 except httplib.IncompleteRead as e: