aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-06-01 21:41:21 +0100
committerJason R. Coombs <jaraco@jaraco.com>2014-06-01 21:41:21 +0100
commit0d688c047fa27b52bc71fb1dc24b30ef8814e1cc (patch)
tree8b61e03e0b4b8c6fb108844481c234e990947b8f
parent109d034dcda2d3578a34811faddabbf90b54f1de (diff)
downloadexternal_python_setuptools-0d688c047fa27b52bc71fb1dc24b30ef8814e1cc.tar.gz
external_python_setuptools-0d688c047fa27b52bc71fb1dc24b30ef8814e1cc.tar.bz2
external_python_setuptools-0d688c047fa27b52bc71fb1dc24b30ef8814e1cc.zip
Perform actual symlink detection; alternate approach to answer Pull Request #53.
--HG-- extra : rebase_source : a70141cd6472cd8e4024be4037bfd89e4adcb396
-rw-r--r--setuptools/tests/test_find_packages.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/setuptools/tests/test_find_packages.py b/setuptools/tests/test_find_packages.py
index 92f7aff7..fe390728 100644
--- a/setuptools/tests/test_find_packages.py
+++ b/setuptools/tests/test_find_packages.py
@@ -12,12 +12,26 @@ from setuptools.tests.py26compat import skipIf
find_420_packages = setuptools.PEP420PackageFinder.find
+# modeled after CPython's test.support.can_symlink
+def can_symlink():
+ TESTFN = tempfile.mktemp()
+ symlink_path = TESTFN + "can_symlink"
+ try:
+ os.symlink(TESTFN, symlink_path)
+ can = True
+ except (OSError, NotImplementedError, AttributeError):
+ can = False
+ else:
+ os.remove(symlink_path)
+ globals().update(can_symlink=lambda: can)
+ return can
+
def has_symlink():
bad_symlink = (
# Windows symlink directory detection is broken on Python 3.2
platform.system() == 'Windows' and sys.version_info[:2] == (3,2)
)
- return hasattr(os, 'symlink') and not bad_symlink
+ return can_symlink() and not bad_symlink
class TestFindPackages(unittest.TestCase):