Commit 829d6b4
'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 9badcb7 commit 829d6b4
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| |||
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
804 | | - | |
805 | | - | |
806 | | - | |
| 804 | + | |
807 | 805 | | |
| 806 | + | |
| 807 | + | |
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| |||
0 commit comments