BUG: `isfile` is not a method on Path objects
BUG: `isfile` is not a method on Path objects

This exists when using `os.path.isfile` but is the wrong method call
for `pathlib.Path` objects.

Remove duplicated import and trailing whitespace as well.

ipython/ipython,ipython/ipython