You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the futurize fixer libfuturize.fixes.fix_unicode_literals_import on a file with a pylint directive, the import is added prior to the pylint directive, which causes them to be ignored. This is true of all directives that don't match the specific regexes of encoding, docstrings and shebang that the future_import method checks for.
from __future__ import unicode_literals
# pylint: disable=import-error,invalid-name
import path
import system
If it skipped to the first non-commented, non-docstring line before inserting anything, it would fix this and any other directives that haven't been accounted for.
The text was updated successfully, but these errors were encountered:
When running the futurize fixer libfuturize.fixes.fix_unicode_literals_import on a file with a pylint directive, the import is added prior to the pylint directive, which causes them to be ignored. This is true of all directives that don't match the specific regexes of encoding, docstrings and shebang that the future_import method checks for.
python-future/src/libfuturize/fixer_util.py
Line 230 in 4657ad2
Before:
Run:
futurize --write --fix=libfuturize.fixes.fix_unicode_literals_import
After:
If it skipped to the first non-commented, non-docstring line before inserting anything, it would fix this and any other directives that haven't been accounted for.
The text was updated successfully, but these errors were encountered: