From: Andrew MacIntyre Date: Tue, 2 Dec 2003 12:43:52 +0000 (+0000) Subject: To find the curses extension as a DLL (on OS/2), we need to adjust the X-Git-Tag: v2.3.3c1~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ccb9ff2fdb3c82aa7ea118bf674309d03e245b14;p=thirdparty%2FPython%2Fcpython.git To find the curses extension as a DLL (on OS/2), we need to adjust the library search path to include the extension directory. Without this, the curses_panel extension can't find the curses extension/DLL, which exports some curses symbols to it. --- diff --git a/Lib/site.py b/Lib/site.py index aad7357a46c4..27974ce9c04c 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -196,6 +196,21 @@ del prefix, sitedir _dirs_in_sys_path = None +# the OS/2 EMX port has optional extension modules that do double duty +# as DLLs (and must use the .DLL file extension) for other extensions. +# The library search path needs to be amended so these will be found +# during module import. Use BEGINLIBPATH so that these are at the start +# of the library search path. +if sys.platform == 'os2emx': + dllpath = os.path.join(sys.prefix, "Lib", "lib-dynload") + libpath = os.environ['BEGINLIBPATH'].split(';') + if libpath[-1]: + libpath.append(dllpath) + else: + libpath[-1] = dllpath + os.environ['BEGINLIBPATH'] = ';'.join(libpath) + + # Define new built-ins 'quit' and 'exit'. # These are simply strings that display a hint on how to exit. if os.sep == ':':