Skip to content

Commit

Permalink
fix issue #139
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Dechaume committed Aug 7, 2014
1 parent ceb240e commit 88d4e3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plumbum/path/local.py
Expand Up @@ -41,7 +41,9 @@ def __init__(self, *parts):
raise TypeError("LocalPath cannot be constructed from %r" % (parts,))
self._path = os.path.normpath(os.path.join(*(str(p) for p in parts)))
def __new__(cls, *parts):
if len(parts) == 1 and isinstance(parts[0], cls):
if len(parts) == 1 and \
isinstance(parts[0], cls) and \
not isinstance(parts[0], LocalWorkdir):
return parts[0]
return object.__new__(cls)
def __str__(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/test_local.py
Expand Up @@ -417,7 +417,8 @@ def test_nesting_lists_as_argv(self):
def test_contains(self):
self.assertTrue("ls" in local, "Expected to find `ls`")


def test_issue_139(self):
LocalPath(local.cwd)

if __name__ == "__main__":
unittest.main()
Expand Down

0 comments on commit 88d4e3c

Please sign in to comment.