Ver código fonte

Fix site detection

Steven Silvester 7 anos atrás
pai
commit
f56143830e
2 arquivos alterados com 5 adições e 3 exclusões
  1. 1 0
      .travis.yml
  2. 4 3
      jupyterlab/commands.py

+ 1 - 0
.travis.yml

@@ -17,6 +17,7 @@ env:
   - GH_REF: github.com/jupyterlab/jupyterlab.git
   - secure: MWpTI6cj3/Bnmtrr0Oqlp2JeWqDneB9aEjlQDaRxLOkqVbxhqDcYW9qAgZZP+sq29vT5oVMWzyCirteKxJfG2vy3HQE1XNLhz82Sf/7sE6DQ51gohl0CcOeA/uA8hCXEw97hneFWsZgHKqSoch7nVDsE3qfYgO+930jHlnxYApJGP9hZFv2Q2NVa6+99kipEYS4BY/yBDYKy6/t4kXcnBrUlNaPtdjnXcrY9esLZ7EQtkaG5VqcQVIBaLJKGF5Q7Aufj5nCFaZ6hZDF1Bi/AbmIbVWFyiT+22i8DZK6YwenECckyzoWkl+bEhYepWsgBKh/BDgPBAmPWKHgU5V4apDaGqZBhF7FP6H02AdZYYuCwl47jyakqvWLZW7oDmorL+HsWG5HQ3m0tMT2ywdbwNOiD39tiPPXjsvROh5ys9vL6NzQvxILCeEOnzcZrFuxi2LGEZfnlqRIjkh1llUAvNc3mOycRLWDOwVQa2+U59qDRXCSY2RD+MOfcdFUGengVujTMaAPMBUa3E33/ZIOOKJtR5TIajYZvd9B2uDlz02QfvTK+hrTaNYJjRZ8WCaeSM/CIKdoLw+29MNO6eqtchw0/vNvM8c9EkhrhMQKcY04OecVhmZkemFhd4SD5l92VX3z3xSxLkmazfNkj3CigWDXNxfDd2ORoGjA46Pga8RM=
 before_install:
+  - ls /usr/bin/pip
   - wget https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-linux64.tar.gz
   - mkdir geckodriver
   - tar -xzf geckodriver-v0.11.1-linux64.tar.gz -C geckodriver

+ 4 - 3
jupyterlab/commands.py

@@ -52,9 +52,10 @@ def get_app_dir(app_dir=None):
     app_dir = pjoin(sys.prefix, 'share', 'jupyter', 'lab')
 
     # Check for a user level install.
-    userbase = getattr(site, 'userbase', '')
-    if here.startswith(userbase) and not app_dir.startswith(userbase):
-        app_dir = pjoin(userbase, 'share', 'jupyter', 'lab')
+    if hasattr(site, 'getuserbase'):
+        userbase = site.getuserbase()
+        if here.startswith(userbase) and not app_dir.startswith(userbase):
+            app_dir = pjoin(userbase, 'share', 'jupyter', 'lab')
 
     # Check for a system install in '/usr/local/share'.
     elif (sys.prefix.startswith('/usr') and not