Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e8a6e0

Browse files
author
Andrew MacIntyre
committed
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.
1 parent c2138af commit 2e8a6e0

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lib/site.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,21 @@ def addpackage(sitedir, name):
194194
_dirs_in_sys_path = None
195195

196196

197+
# the OS/2 EMX port has optional extension modules that do double duty
198+
# as DLLs (and must use the .DLL file extension) for other extensions.
199+
# The library search path needs to be amended so these will be found
200+
# during module import. Use BEGINLIBPATH so that these are at the start
201+
# of the library search path.
202+
if sys.platform == 'os2emx':
203+
dllpath = os.path.join(sys.prefix, "Lib", "lib-dynload")
204+
libpath = os.environ['BEGINLIBPATH'].split(';')
205+
if libpath[-1]:
206+
libpath.append(dllpath)
207+
else:
208+
libpath[-1] = dllpath
209+
os.environ['BEGINLIBPATH'] = ';'.join(libpath)
210+
211+
197212
# Define new built-ins 'quit' and 'exit'.
198213
# These are simply strings that display a hint on how to exit.
199214
if os.sep == ':':

0 commit comments

Comments
 (0)