summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2012-02-13 12:47:59 -0800
committerJeff Forcier <jeff@bitprophet.org>2012-09-23 16:10:42 -0700
commit1882f3470b8d16b56fd958e6dbd9e6c8a0666946 (patch)
tree2460969c5252993df9363a01965cc3bf7d12c5fd
parentc3e9b76d513e67f7091b6366911d581633db0936 (diff)
Move fcntl import to avoid high level ImportErrors on Windows
Fixes #5. (cherry picked from commit ec2aedac71d19b48aa8da9813ccae8e82eef981c)
-rw-r--r--CHANGES6
-rw-r--r--paramiko/agent.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index df8f1d31..8427e69f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
Temporary, post-Paramiko changelog while we get our sh!t together.
+## ssh 1.7.13 (2012-MM-DD)
+
+* Moved a `fcntl` import closer to where it's used to help avoid `ImportError`
+ problems on Windows platforms. Thanks to Jason Coombs for the catch +
+ suggested fix.
+
## ssh 1.7.12 (2012-02-10)
* Added an IO loop sleep() call to avoid needless CPU usage when agent
diff --git a/paramiko/agent.py b/paramiko/agent.py
index 306fc237..3772d513 100644
--- a/paramiko/agent.py
+++ b/paramiko/agent.py
@@ -28,7 +28,6 @@ import threading
import time
import tempfile
import stat
-import fcntl
from select import select
from paramiko.ssh_exception import SSHException
@@ -119,6 +118,7 @@ class AgentProxyThread(threading.Thread):
raise
def _communicate(self):
+ import fcntl
oldflags = fcntl.fcntl(self.__inr, fcntl.F_GETFL)
fcntl.fcntl(self.__inr, fcntl.F_SETFL, oldflags | os.O_NONBLOCK)
while not self._exit: