Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/utils/environ.py

    r11410 r11456  
    9292""" 
    9393 
    94 import os, sys 
     94import os 
     95import sys 
     96 
    9597import ConfigParser 
    9698import pkg_resources 
    9799from pkg_resources import working_set 
    98100 
     101 
    99102def _path_fix(): 
    100     """ Fix some common problems with $(PATH) and sys.path 
     103    """Fix some common problems with $(PATH) and sys.path 
    101104    """ 
    102105    if os.name == "nt": 
    103106        ## Move any miktex paths containing Qt's dll to the end of the %PATH% 
    104107        paths = os.environ["PATH"].split(";") 
    105         paths.sort(lambda x,y: -1 if "PyQt4" in x else (1 if "miktex" in y and \ 
    106                         os.path.exists(os.path.join(y, "QtCore4.dll")) else 0)) 
     108        paths = sorted(paths, key=lambda path: 1 if "miktex" in path else 0) 
    107109        os.environ["PATH"] = ";".join(paths) 
    108          
     110 
    109111    if sys.platform == "darwin": 
    110112        ## PyQt4 installed from fink is installed in %{FINK_ROOT}lib/qt4-mac/lib/python${PYVERSION}/site-packages" 
    111         posible_fink_pyqt4_path = os.path.join(sys.prefix,  
    112                 "lib/qt4-mac/lib/python" + sys.version[:3] + "/site-packages") 
     113        posible_fink_pyqt4_path = os.path.join( 
     114            sys.prefix, "lib/qt4-mac/lib/python" + sys.version[:3] + "/site-packages") 
    113115        if os.path.exists(posible_fink_pyqt4_path): 
    114116            sys.path.append(posible_fink_pyqt4_path) 
    115              
     117 
    116118_path_fix() 
     119 
    117120 
    118121def _get_default_env(): 
Note: See TracChangeset for help on using the changeset viewer.