]> jfr.im git - z_archive/twitter.git/commit
Fixes oauth2_dance when a token_filename is passed
authorDex <redacted>
Mon, 23 Nov 2015 15:55:24 +0000 (07:55 -0800)
committerDex <redacted>
Mon, 23 Nov 2015 16:01:00 +0000 (08:01 -0800)
commitea5c34dd41fa18abc2deacd94c9611e11e936ab7
treecacfef01572ffbdde1aa4fc130a13f72644a6621
parent7feb351bf043a9bd93a47461a1a457281a443b54
Fixes oauth2_dance when a token_filename is passed

It looks like `oauth2_dance` doesn't currently pass the
correct number of arguments to `oauth2.write_bearer_token_file`.

This results in a `TypeError`:

```
>>> cons = 'MY_KEY'
>>> sec = 'MY_SECRET'
>>> oauth2_dance(cons, sec, 'bearer.txt')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Users/dex/.venv/lib/python2.7/site-packages/twitter/oauth_dance.py", line 30, in oauth2_dance
    write_bearer_token_file(token)
TypeError: write_bearer_token_file() takes exactly 2 arguments (1
given)
```

This change updates `oauth2_dance` to pass both the token and the
filename to `write_bearer_token_file`.
twitter/oauth_dance.py