Permalink
Browse files

Merge pull request #85 from jaraco/master

path wrapper fails when attributes aren't present
  • Loading branch information...
2 parents 7437ee9 + be4a8b3 commit 815541895f13c1a8e3d51a4bb16e27f26aa71987 @Almad Almad committed Dec 11, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 paver/path.py
View
@@ -20,15 +20,15 @@
@contextmanager
def pushd(dir):
- '''A context manager (Python 2.5+ only) for stepping into a
- directory and automatically coming back to the previous one.
+ '''A context manager (Python 2.5+ only) for stepping into a
+ directory and automatically coming back to the previous one.
The original directory is returned. Usage is like this::
-
+
from __future__ import with_statement
# the above line is only needed for Python 2.5
-
+
from paver.easy import *
-
+
@task
def my_task():
with pushd('new/directory') as old_dir:
@@ -83,6 +83,7 @@ def wrapper(*args, **kwds):
for name in _METHOD_BLACKLIST:
+ if not hasattr(_orig_path, name):
+ continue
wrapper = _make_wrapper(name, getattr(_orig_path, name))
setattr(path, name, wrapper)
-

0 comments on commit 8155418

Please sign in to comment.