summaryrefslogtreecommitdiff
path: root/security/fsh/patches/patch-aa
blob: 883a5f1b7dffbd874142c2802c946a5d65521d61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$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 <URL:http://sourceforge.net/tracker/
 # ?func=detail&aid=496171&group_id=5470&atid=105470>.
 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: