Commit 2a7dab4
'buffer' and 'file' are undefined names in Python 3
__cloudpickle.py__ refers to:
* __buffer__ which was removed from Python 3 in favor of [memoryview](https://docs.python.org/2/c-api/buffer.html)
* __file__ which was removed from Python 3 in favor of __io.TextIOWrapper__
The try/except approach for __file__ follows the Python porting best practice [use feature detection instead of version detection](https://docs.python.org/3/howto/pyporting.html#use-feature-detection-instead-of-version-detection).1 parent f14d19d commit 2a7dab4
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
818 | | - | |
819 | | - | |
820 | | - | |
| 818 | + | |
821 | 819 | | |
| 820 | + | |
| 821 | + | |
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
| |||
0 commit comments