Closed marsfan closed 2 years ago
Sometimes I need to add a path to the system path to be able to import a file. (Commonly when working with Sphinx).
When I then run autopep8 to format the file, it moves the imports to be above the call to sys.path.insert, breaking the code.
sys.path.insert
import os import sys sys.path.insert(0, os.path.abspath("..")) import test_package
Command Line
$ autopep8 conf.py
Ok. I just realized that this is likely due to pycodestyle, not this extension. Closing
wdym? This is a regression as autopep8 should be safe.
Sometimes I need to add a path to the system path to be able to import a file. (Commonly when working with Sphinx).
When I then run autopep8 to format the file, it moves the imports to be above the call to
sys.path.insert
, breaking the code.Python Code
Command Line and Configuration
Command Line
Your Environment