Changeset 11732:268717fbedb4 in orange


Ignore:
Timestamp:
10/16/13 11:57:57 (6 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Changed the way virtualenv is detected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/utils/addons.py

    r11695 r11732  
    414414 
    415415        switches = [] 
    416         if site.USER_SITE in sys.path:   # we're not in a virtualenv 
     416        if not hasattr(sys, "real_prefix"): 
     417            # we're not in a virtualenv 
    417418            switches.append('--user') 
    418419        run_setup(setup_py, ['install'] + switches) 
     
    435436    from setuptools.command import easy_install 
    436437    # Check if easy_install supports '--user' switch 
    437     if "user" in [opt[0] for opt in easy_install.easy_install.user_options]: 
    438         has_user_site = True 
    439     else: 
    440         has_user_site = False 
    441  
    442     if has_user_site and site.USER_SITE in sys.path: 
     438    options = [opt[0] for opt in easy_install.easy_install.user_options] 
     439    has_user_site = "user" in options 
     440 
     441    if has_user_site and not hasattr(sys, "real_prefix"): 
     442        # we're not in a virtualenv 
     443        # (why are we assuming we have write permissions in the 
     444        # virtualenv's site dir?) 
    443445        args = ["--user"] + args 
    444446 
Note: See TracChangeset for help on using the changeset viewer.