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

a4aba9f
From 6701ebf1208d5b129d83999dab4ea792c4f60c35 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
c440ca5
--- a/mypy/build.py
c440ca5
+++ b/mypy/build.py
f795963
@@ -246,6 +246,10 @@ def default_data_dir(bin_dir: str) -> st
f795963
             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'