|
38 | 38 | # |
39 | 39 | # Some parts of the IECore library are defined purely in Python. These are shown below. |
40 | 40 |
|
41 | | -import os, sys, ctypes, pathlib |
42 | | -if os.name == "posix" and os.environ.get( "IECORE_RTLD_GLOBAL", "1" ) == "1" : |
43 | | - # Historically, we had problems with cross-module RTTI on Linux, whereby |
44 | | - # different Python modules and/or libraries could end up with their own |
45 | | - # copies of symbols, which would break things like dynamic casts. We worked |
46 | | - # around this by using RTLD_GLOBAL so that everything was loaded into the |
47 | | - # global symbol table and shared, but this can cause hard-to-diagnose |
48 | | - # knock-on effects from unwanted sharing. |
49 | | - # |
50 | | - # We now manage symbol visibility properly so that RTTI symbols should not |
51 | | - # be duplicated between modules, and we intend to remove RTLD_GLOBAL. To aid |
52 | | - # the transition, this behaviour can be controlled by the |
53 | | - # `IECORE_RTLD_GLOBAL` environment variable, which currently defaults on. |
54 | | - ## \todo Get everything tested, default to off, and then remove. |
55 | | - sys.setdlopenflags( |
56 | | - sys.getdlopenflags() | ctypes.RTLD_GLOBAL |
57 | | - ) |
| 41 | +import os, pathlib |
58 | 42 |
|
59 | 43 | if hasattr( os, "add_dll_directory" ) and "IECORE_DLL_DIRECTORIES" in os.environ : |
60 | 44 | for directory in os.environ.get( "IECORE_DLL_DIRECTORIES" ).split( os.pathsep ) : |
|
64 | 48 | del directory |
65 | 49 |
|
66 | 50 | # Remove pollution of IECore namespace |
67 | | -del os, sys, ctypes, pathlib |
| 51 | +del os, pathlib |
68 | 52 |
|
69 | 53 | __import__( "imath" ) |
70 | 54 |
|
|
0 commit comments