Jelajahi Sumber

Import fcntl rather than pieces from it

Mike Naberezny 10 tahun lalu
induk
melakukan
59fc5b9558
1 mengubah file dengan 3 tambahan dan 4 penghapusan
  1. 3 4
      supervisor/options.py

+ 3 - 4
supervisor/options.py

@@ -17,9 +17,7 @@ import select
 import glob
 import platform
 import warnings
-
-from fcntl import fcntl
-from fcntl import F_SETFL, F_GETFL
+import fcntl
 
 from supervisor.medusa import asyncore_25 as asyncore
 
@@ -1493,7 +1491,8 @@ class ServerOptions(Options):
                 pipes['stderr'], pipes['child_stderr'] = stderr, child_stderr
             for fd in (pipes['stdout'], pipes['stderr'], pipes['stdin']):
                 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
         except OSError:
             for fd in pipes.values():