summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorBrian Curtin <brian.curtin@gmail.com>2010-12-28 14:31:47 (GMT)
committerBrian Curtin <brian.curtin@gmail.com>2010-12-28 14:31:47 (GMT)
commit3b4499c5c7718a2aca8558b857dfe02cc4a80cd9 (patch)
treee952e750f0913c99ca1d4b021736476baab55408 /Lib/test/test_os.py
parentbaab9d0bf6d1627aa292a7639878ae9ba46fc2ca (diff)
downloadcpython-3b4499c5c7718a2aca8558b857dfe02cc4a80cd9.zip
cpython-3b4499c5c7718a2aca8558b857dfe02cc4a80cd9.tar.gz
cpython-3b4499c5c7718a2aca8558b857dfe02cc4a80cd9.tar.bz2
Fix #9333. The symlink function is always available now, raising OSError
when the user doesn't hold the symbolic link privilege rather than hiding it.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 9cfd7b8..497d809 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -541,7 +541,7 @@ class WalkTests(unittest.TestCase):
f = open(path, "w")
f.write("I'm " + path + " and proud of it. Blame test_os.\n")
f.close()
- if hasattr(os, "symlink"):
+ if support.can_symlink():
os.symlink(os.path.abspath(t2_path), link_path)
sub2_tree = (sub2_path, ["link"], ["tmp3"])
else:
@@ -585,7 +585,7 @@ class WalkTests(unittest.TestCase):
self.assertEqual(all[flipped + 1], (sub1_path, ["SUB11"], ["tmp2"]))
self.assertEqual(all[2 - 2 * flipped], sub2_tree)
- if hasattr(os, "symlink"):
+ if support.can_symlink():
# Walk, following symlinks.
for root, dirs, files in os.walk(walk_path, followlinks=True):
if root == link_path:
@@ -1149,7 +1149,7 @@ class Win32KillTests(unittest.TestCase):
@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
-@unittest.skipUnless(hasattr(os, "symlink"), "Requires symlink implementation")
+@support.skip_unless_symlink
class Win32SymlinkTests(unittest.TestCase):
filelink = 'filelinktest'
filelink_target = os.path.abspath(__file__)