summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-11-30 21:12:15 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-11-30 21:12:15 (GMT)
commit8a1a17b309b09a986b874ff322171842392d98d4 (patch)
tree4b37379cf96c4dc4b64961ccdff02133a45b6299 /Lib
parent8da8268b1f4d06866b36f0ffce5c8bc3c33ba01a (diff)
downloadcpython-8a1a17b309b09a986b874ff322171842392d98d4.zip
cpython-8a1a17b309b09a986b874ff322171842392d98d4.tar.gz
cpython-8a1a17b309b09a986b874ff322171842392d98d4.tar.bz2
Remove redundant check for symlink. (closes #6036)
Patch by Bruno Dupuis.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_posixpath.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 957a903..aaf4d66 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -110,8 +110,10 @@ class PosixPathTest(unittest.TestCase):
),
True
)
- # If we don't have links, assume that os.stat doesn't return resonable
- # inode information and thus, that samefile() doesn't work
+
+ # If we don't have links, assume that os.stat doesn't return
+ # reasonable inode information and thus, that samefile() doesn't
+ # work.
if hasattr(os, "symlink"):
os.symlink(
test_support.TESTFN + "1",
@@ -152,18 +154,17 @@ class PosixPathTest(unittest.TestCase):
True
)
# If we don't have links, assume that os.stat() doesn't return resonable
- # inode information and thus, that samefile() doesn't work
+ # inode information and thus, that samestat() doesn't work
if hasattr(os, "symlink"):
- if hasattr(os, "symlink"):
- os.symlink(test_support.TESTFN + "1", test_support.TESTFN + "2")
- self.assertIs(
- posixpath.samestat(
- os.stat(test_support.TESTFN + "1"),
- os.stat(test_support.TESTFN + "2")
- ),
- True
- )
- os.remove(test_support.TESTFN + "2")
+ os.symlink(test_support.TESTFN + "1", test_support.TESTFN + "2")
+ self.assertIs(
+ posixpath.samestat(
+ os.stat(test_support.TESTFN + "1"),
+ os.stat(test_support.TESTFN + "2")
+ ),
+ True
+ )
+ os.remove(test_support.TESTFN + "2")
f = open(test_support.TESTFN + "2", "wb")
f.write("bar")
f.close()