Move fcntl import to avoid high level ImportErrors on Windows

Fixes #5.
This commit is contained in:
Jeff Forcier 2012-02-13 12:47:59 -08:00
parent 3e4632979f
commit ec2aedac71
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,11 @@
Temporary, post-Paramiko changelog while we get our sh!t together. 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) ## ssh 1.7.12 (2012-02-10)
* Added an IO loop sleep() call to avoid needless CPU usage when agent * Added an IO loop sleep() call to avoid needless CPU usage when agent

View File

@ -28,7 +28,6 @@ import threading
import time import time
import tempfile import tempfile
import stat import stat
import fcntl
from select import select from select import select
from ssh.ssh_exception import SSHException from ssh.ssh_exception import SSHException
@ -119,6 +118,7 @@ class AgentProxyThread(threading.Thread):
raise raise
def _communicate(self): def _communicate(self):
import fcntl
oldflags = fcntl.fcntl(self.__inr, fcntl.F_GETFL) oldflags = fcntl.fcntl(self.__inr, fcntl.F_GETFL)
fcntl.fcntl(self.__inr, fcntl.F_SETFL, oldflags | os.O_NONBLOCK) fcntl.fcntl(self.__inr, fcntl.F_SETFL, oldflags | os.O_NONBLOCK)
while not self._exit: while not self._exit: