瀏覽代碼

Import fcntl rather than pieces from it

Mike Naberezny 10 年之前
父節點
當前提交
59fc5b9558
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      supervisor/options.py

+ 3 - 4
supervisor/options.py

@@ -17,9 +17,7 @@ import select
 import glob
 import glob
 import platform
 import platform
 import warnings
 import warnings
-
-from fcntl import fcntl
-from fcntl import F_SETFL, F_GETFL
+import fcntl
 
 
 from supervisor.medusa import asyncore_25 as asyncore
 from supervisor.medusa import asyncore_25 as asyncore
 
 
@@ -1493,7 +1491,8 @@ class ServerOptions(Options):
                 pipes['stderr'], pipes['child_stderr'] = stderr, child_stderr
                 pipes['stderr'], pipes['child_stderr'] = stderr, child_stderr
             for fd in (pipes['stdout'], pipes['stderr'], pipes['stdin']):
             for fd in (pipes['stdout'], pipes['stderr'], pipes['stdin']):
                 if fd is not None:
                 if fd is not None:
-                    fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | os.O_NDELAY)
+                    flags = fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NDELAY
+                    fcntl.fcntl(fd, fcntl.F_SETFL, flags)
             return pipes
             return pipes
         except OSError:
         except OSError:
             for fd in pipes.values():
             for fd in pipes.values():