summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoah <noah@656d521f-e311-0410-88e0-e7920216d269>2012-08-23 21:58:52 +0000
committernoah <noah@656d521f-e311-0410-88e0-e7920216d269>2012-08-23 21:58:52 +0000
commit8db22799d64773b16a967da3c18d204f153e148c (patch)
treefda1b2636371b4f4ac7fc81198633a4c8f7c0451
parent8aa8b7076ac45f3862fb55349c052f077e2a1a93 (diff)
downloadpexpect-8db22799d64773b16a967da3c18d204f153e148c.tar.gz
Finished PEP8 modifications.
git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@529 656d521f-e311-0410-88e0-e7920216d269
-rw-r--r--pexpect/pexpect.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/pexpect/pexpect.py b/pexpect/pexpect.py
index 0896ef9..87151d3 100644
--- a/pexpect/pexpect.py
+++ b/pexpect/pexpect.py
@@ -622,11 +622,11 @@ class spawn(object):
parent_fd, child_fd = os.openpty()
if parent_fd < 0 or child_fd < 0:
- raise ExceptionPexpect, "Could not open with os.openpty()."
+ raise ExceptionPexpect("Could not open with os.openpty().")
pid = os.fork()
if pid < 0:
- raise ExceptionPexpect, "Failed os.fork()."
+ raise ExceptionPexpect("Failed os.fork().")
elif pid == 0:
# Child.
os.close(parent_fd)
@@ -669,8 +669,8 @@ class spawn(object):
fd = os.open("/dev/tty", os.O_RDWR | os.O_NOCTTY)
if fd >= 0:
os.close(fd)
- raise ExceptionPexpect, 'Failed to disconnect from ' + \
- 'controlling tty. It is still possible to open /dev/tty.'
+ raise ExceptionPexpect('Failed to disconnect from ' +
+ 'controlling tty. It is still possible to open /dev/tty.')
except:
# Good! We are disconnected from a controlling tty.
pass
@@ -678,14 +678,14 @@ class spawn(object):
# Verify we can open child pty.
fd = os.open(child_name, os.O_RDWR)
if fd < 0:
- raise ExceptionPexpect, "Could not open child pty, " + child_name
+ raise ExceptionPexpect("Could not open child pty, " + child_name)
else:
os.close(fd)
# Verify we now have a controlling tty.
fd = os.open("/dev/tty", os.O_WRONLY)
if fd < 0:
- raise ExceptionPexpect, "Could not open controlling tty, /dev/tty"
+ raise ExceptionPexpect("Could not open controlling tty, /dev/tty")
else:
os.close(fd)
@@ -1878,7 +1878,8 @@ def which(filename):
if os.access(filename, os.X_OK):
return filename
- if not os.environ.has_key('PATH') or os.environ['PATH'] == '':
+ #if not os.environ.has_key('PATH') or os.environ['PATH'] == '':
+ if not 'PATH' in os.environ or os.environ['PATH'] == '':
p = os.defpath
else:
p = os.environ['PATH']