Commit 67cf8be7 authored by Fred Drake's avatar Fred Drake

Do not import FCNTL unless we actually have to, avoiding a warning from

Python 2.2.
parent 71b802eb
...@@ -18,8 +18,9 @@ import sys, os ...@@ -18,8 +18,9 @@ import sys, os
# brokenness in the Python 2.1 version. We need to do some funny business # brokenness in the Python 2.1 version. We need to do some funny business
# to make this work, as a 2.2-ism crept into the asyncore code. # to make this work, as a 2.2-ism crept into the asyncore code.
if os.name == 'posix': if os.name == 'posix':
import fcntl, FCNTL import fcntl
if not hasattr(fcntl, 'F_GETFL'): if not hasattr(fcntl, 'F_GETFL'):
import FCNTL
fcntl.F_GETFL = FCNTL.F_GETFL fcntl.F_GETFL = FCNTL.F_GETFL
fcntl.F_SETFL = FCNTL.F_SETFL fcntl.F_SETFL = FCNTL.F_SETFL
......
...@@ -18,8 +18,9 @@ import sys, os ...@@ -18,8 +18,9 @@ import sys, os
# brokenness in the Python 2.1 version. We need to do some funny business # brokenness in the Python 2.1 version. We need to do some funny business
# to make this work, as a 2.2-ism crept into the asyncore code. # to make this work, as a 2.2-ism crept into the asyncore code.
if os.name == 'posix': if os.name == 'posix':
import fcntl, FCNTL import fcntl
if not hasattr(fcntl, 'F_GETFL'): if not hasattr(fcntl, 'F_GETFL'):
import FCNTL
fcntl.F_GETFL = FCNTL.F_GETFL fcntl.F_GETFL = FCNTL.F_GETFL
fcntl.F_SETFL = FCNTL.F_SETFL fcntl.F_SETFL = FCNTL.F_SETFL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment