From ee36c24d15e734cd8c95ef6568f65bf02fa1e71b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 13 Nov 2012 09:31:51 +0100 Subject: [PATCH] Issue #15478: os.lchflags() is not always available when os.chflags() is available --- Lib/test/test_os.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 09d3e7545b9..13f9e3ab157 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -2112,10 +2112,9 @@ class OSErrorTests(unittest.TestCase): if hasattr(os, "truncate"): funcs.append((self.filenames, os.truncate, 0)) if hasattr(os, "chflags"): - funcs.extend(( - (self.filenames, os.chflags, 0), - (self.filenames, os.lchflags, 0), - )) + funcs.append((self.filenames, os.chflags, 0)) + if hasattr(os, "lchflags"): + funcs.append((self.filenames, os.lchflags, 0)) if hasattr(os, "chroot"): funcs.append((self.filenames, os.chroot,)) if hasattr(os, "link"):