diff --git a/dist/isort-1.2.3.tar.gz b/dist/isort-1.2.3.tar.gz new file mode 100644 index 000000000..4155e85c6 Binary files /dev/null and b/dist/isort-1.2.3.tar.gz differ diff --git a/isort/__init__.py b/isort/__init__.py index 7aff572af..c7b884d2a 100644 --- a/isort/__init__.py +++ b/isort/__init__.py @@ -25,4 +25,4 @@ from . import settings from .isort import SortImports -__version__ = "1.2.2" +__version__ = "1.2.3" diff --git a/isort/isort.py b/isort/isort.py index a27f7fbc9..e651929e8 100644 --- a/isort/isort.py +++ b/isort/isort.py @@ -55,6 +55,7 @@ def __init__(self, file_path=None, file_contents=None, **setting_overrides): file_name = file_path if file_path: + file_path = os.path.abspath(file_path) if "/" in file_name: file_name = file_name[file_name.rfind('/') + 1:] if file_name in self.config['skip']: @@ -83,7 +84,7 @@ def __init__(self, file_path=None, file_contents=None, **setting_overrides): self.output = "\n".join(self.out_lines) if file_name: - with open(file_name, "w") as outputFile: + with open(self.file_path, "w") as outputFile: outputFile.write(self.output) def place_module(self, moduleName): diff --git a/setup.py b/setup.py index dd73a5409..11fe6ed1f 100755 --- a/setup.py +++ b/setup.py @@ -3,13 +3,13 @@ from distutils.core import setup setup(name='isort', - version='1.2.2', + version='1.2.3', description='A Python utility / library to sort Python imports.', author='Timothy Crosley', author_email='timothy.crosley@gmail.com', url='https://github.com/timothycrosley/isort', download_url='https://github.com/timothycrosley/isort/blob/master' - '/dist/isort-1.2.2.tar.gz?raw=true', + '/dist/isort-1.2.3.tar.gz?raw=true', license="MIT", scripts=['scripts/isort'], packages=['isort'],