lxyu / weibo

Python sina weibo sdk. More simpler and cleaner than the official one.
http://lxyu.github.io/weibo/
236 stars 82 forks source link

报错 TypeError: session() takes no arguments (1 given) #4

Closed bgee closed 11 years ago

bgee commented 11 years ago

当执行c.set_code('code')时报错

Requests版本1.0.4

File "bot.py", line 9, in c.set_code(code) File "/Library/Python/2.7/site-packages/weibo.py", line 83, in set_code self.set_token(tk['access_token'], time.time() + int(tk['expires_in'])) File "/Library/Python/2.7/site-packages/weibo.py", line 92, in set_token params={'access_token': self.access_token}) TypeError: session() takes no arguments (1 given)

lxyu commented 11 years ago

我这里无法重现,请按照 http://lxyu.github.com/weibo/ 这里的过程重试一下看看是否还有问题。

CNBorn commented 11 years ago

将92行改为

self.session = requests.session()
self.session.params={'access_token': self.access_token}
lxyu commented 11 years ago

Thanks.