Blame 0002-Canonicalize-bin_dir-when-looking-for-data_dir.patch

9878e9d
From 90222ce2272cda680a71671e82177d752e2ae547 Mon Sep 17 00:00:00 2001
c440ca5
From: David Shea <dshea@redhat.com>
c440ca5
Date: Thu, 7 Jan 2016 10:02:27 -0500
a4aba9f
Subject: [PATCH 2/2] Canonicalize bin_dir when looking for data_dir.
c440ca5
c440ca5
This way calling mypy as /bin/mypy will look for the data dir starting
c440ca5
in /usr instead of /.
c440ca5
---
c440ca5
 mypy/build.py | 4 ++++
c440ca5
 1 file changed, 4 insertions(+)
c440ca5
8b13ee8
diff --git a/mypy/build.py b/mypy/build.py
9878e9d
index 6195b7d..0e139bb 100644
c440ca5
--- a/mypy/build.py
c440ca5
+++ b/mypy/build.py
9878e9d
@@ -214,6 +214,10 @@ def default_data_dir(bin_dir: Optional[str]) -> str:
fbd8101
             return subdir
c440ca5
         # Default to directory containing this file's parent.
a4aba9f
         return parent
c440ca5
+
c440ca5
+    # Canonicalize the path in case bin_dir is a symlink
c440ca5
+    bin_dir = os.path.realpath(bin_dir)
c440ca5
+
c440ca5
     base = os.path.basename(bin_dir)
c440ca5
     dir = os.path.dirname(bin_dir)
c440ca5
     if (sys.platform == 'win32' and base.lower() == 'scripts'
8b13ee8
-- 
9878e9d
2.9.2
8b13ee8