Changeset 383 for python


Ignore:
Timestamp:
Mar 13, 2014, 9:58:41 PM (11 years ago)
Author:
dmik
Message:

Restore original dynamic 'sys.prefix' detection.

This in particular reverts r20 and parts of r10. These hacks are not
necessary after properly defining 'sys.path' entries in 'site.py'.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk/Lib/site.py

    r58 r383  
    263263        seen.append(prefix)
    264264
    265         if sys.platform in ('os2emx', 'os2knix', 'riscos'):
     265        if sys.platform in ('os2emx', 'riscos'):
    266266            sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
     267        elif sys.platform == 'os2knix':
     268            sitedirs.append(os.path.join(prefix, "lib",
     269                                        "python" + sys.version[:3],
     270                                        "site-packages"))
     271            sitedirs.append(os.path.join(prefix, "lib", "site-packages"))
    267272        elif os.sep == '/':
    268273            sitedirs.append(os.path.join(prefix, "lib",
     
    488493    abs__file__()
    489494    known_paths = removeduppaths()
    490     if (os.name == "posix" and sys.path and
    491         os.path.basename(sys.path[-1]) == "Modules"):
     495    if ((os.name == "posix" or os.name == "os2") and
     496        sys.path and os.path.basename(sys.path[-1]) == "Modules"):
    492497        addbuilddir()
     498        if (os.name == "os2"):
     499            setBEGINLIBPATH()
    493500    if ENABLE_USER_SITE is None:
    494501        ENABLE_USER_SITE = check_enableusersite()
    495502    known_paths = addusersitepackages(known_paths)
    496503    known_paths = addsitepackages(known_paths)
    497     if sys.platform == 'os2emx' or sys.platform == 'os2knix':
    498         if (sys.path and os.path.basename(sys.path[-1]) == "Modules"):
    499             addbuilddir()
    500         setBEGINLIBPATH()
    501504    setquit()
    502505    setcopyright()
  • python/trunk/Modules/getpath.c

    r20 r383  
    117117#endif
    118118
    119 #ifndef __EMX__
    120119#ifndef PYTHONPATH
    121120#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
    122121              EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
    123 #endif
    124 #else
    125 //#define PYTHONPATH    "./Lib;./Lib/plat-" PLATFORM \
    126 //                      ";./Lib/lib-dynload;./Lib/site-packages"
    127 // force unixroot
    128 #define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
    129               EXEC_PREFIX "/lib/python" VERSION "/lib-" PLATFORM ":" \
    130               EXEC_PREFIX "/lib/python" VERSION "/site-packages" ":" \
    131               EXEC_PREFIX "/lib/python" VERSION "/lib-dynload" ":" \
    132 /* now local (for building) */ \
    133               "./lib" ":" \
    134               "./lib/plat-" PLATFORM ":" \
    135               "./lib/site-packages" ":" \
    136               "./lib/lib-dynload"
    137122#endif
    138123
     
    660645     * return the compiled-in defaults instead.
    661646     */
    662 #ifndef __KLIBC__ // YD force hardcoded build prefix
    663647    if (pfound > 0) {
    664648        reduce(prefix);
     
    670654    }
    671655    else
    672 #endif
    673656        strncpy(prefix, PREFIX, MAXPATHLEN);
    674657
    675 #ifndef __KLIBC__ // YD force hardcoded build exec_prefix
    676658    if (efound > 0) {
    677659        reduce(exec_prefix);
     
    682664    }
    683665    else
    684 #endif
    685666        strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
    686667}
Note: See TracChangeset for help on using the changeset viewer.