Need also to remove 'from builtins import str'

[Imported from Trac: page Python3, version 74]
jaraco 2021-02-15 17:37:37 +00:00
parent 722624c406
commit 95985716d2

@ -106,6 +106,7 @@ Delete this bit:
```#!python ```#!python
from future import standard_library from future import standard_library
standard_library.install_aliases() standard_library.install_aliases()
from builtins import str
``` ```
And replace the `from builtins import *` variant, if any, with: And replace the `from builtins import *` variant, if any, with:
@ -121,7 +122,7 @@ This adds builtins that match Python 3's semantics. The `#noqa: F401` keeps flak
Consider using this sed command to execute the above: Consider using this sed command to execute the above:
``` ```
$ sed -ie '/from future import standard_library/d;/standard_library.install_aliases()/d;s/from builtins import \*/from future.utils import PY2\\nif PY2:\\n from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401/' path/to/file.py $ sed -ie '/from future import standard_library/d;/standard_library.install_aliases()/d;/from builtins import str/d;s/from builtins import \*/from future.utils import PY2\\nif PY2:\\n from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401/' src/allmydata/test/test_runner.py
``` ```
**Fourth**, manually review the code. Futureize is nice, but it very definitely doesn't catch everything, or it makes wrong decisions. **Fourth**, manually review the code. Futureize is nice, but it very definitely doesn't catch everything, or it makes wrong decisions.