$NetBSD: patch-aa,v 1.1 2005/03/20 12:51:54 fredb Exp $ --- fshcompat.py.orig 2001-12-23 05:08:26.000000000 -0600 +++ fshcompat.py @@ -52,20 +52,23 @@ except: # in Python 2.2 as a bug. See . try: - # Stop Python 2.2 from warning that we import a deprecated module. - # But Python 1.5.2 doesn't have the warnings module, so be prepared - # for the import statement to fail. try: - import warnings - warnings.filterwarnings( - "ignore", - "the FCNTL module is deprecated; please use fcntl", - DeprecationWarning) - except ImportError: - pass + FD_CLOEXEC = fcntl.FD_CLOEXEC + except: + # Stop Python 2.2 from warning that we import a deprecated module. + # But Python 1.5.2 doesn't have the warnings module, so be prepared + # for the import statement to fail. + try: + import warnings + warnings.filterwarnings( + "ignore", + "the FCNTL module is deprecated; please use fcntl", + DeprecationWarning) + except ImportError: + pass - import FCNTL - FD_CLOEXEC = FCNTL.FD_CLOEXEC + import FCNTL + FD_CLOEXEC = FCNTL.FD_CLOEXEC except AttributeError: