Skip to content
Commit c37b0b2b authored by Daniel Hahler's avatar Daniel Hahler
Browse files

Fix `--diff` with stdin

This fixes the following error with `isort --diff -`:

    Traceback (most recent call last):
      File "…/pyenv/project/bin/isort", line 9, in <module>
        load_entry_point('isort', 'console_scripts', 'isort')()
      File "…/isort/isort/main.py", line 239, in main
        SortImports(file_contents=sys.stdin.read(), write_to_stdout=True, **arguments)
      File "…/isort/isort/isort.py", line 170, in __init__
        self._show_diff(file_contents)
      File "…/isort/isort/isort.py", line 194, in _show_diff
        fromfiledate=str(datetime.fromtimestamp(os.path.getmtime(self.file_path))),
      File "…/pyenv/project/lib/python3.5/genericpath.py", line 55, in getmtime
        return os.stat(filename).st_mtime
    FileNotFoundError: [Errno 2] No such file or directory: ''
parent 1bd058c1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment