Skip to content

Commit

Permalink
SudoProxy: don't assume the passed object is an Esky instance
Browse files Browse the repository at this point in the history
  • Loading branch information
rfk committed Aug 10, 2010
1 parent 6367d07 commit 544c121
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion esky/sudo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ class SudoProxy(object):
"""Object method proxy with root privileges."""

def __init__(self,target):
self.name = target.name
# Reflect the 'name' attribute if it has one, but don't worry
# if not. This helps SudoProxy be re-used on other clases.
try:
self.name = target.name
except AttributeError:
pass
self.target = target
self.closed = False
self.pipe = None
Expand Down

0 comments on commit 544c121

Please sign in to comment.