We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6107513 commit 5a20fc7Copy full SHA for 5a20fc7
1 file changed
src/iop/cls/IOP/Common.cls
@@ -147,17 +147,12 @@ ClassMethod SetPythonPath(pClasspaths)
147
148
// Add the classpaths to the Python sys.path only if they are not already present
149
// Check if the path is already in sys.path
150
- set found = 0
151
- for j=1:1:sys.path."__len__"() {
152
- if sys.path."__getitem__"(j-1) = pClasspaths {
153
- set found = 1
154
- quit
155
- }
156
157
- if found = 0 {
158
- // If not found, add to sys.path
159
- do sys.path."append"(pClasspaths)
+ if (sys.path."__len__"() > 0) && (sys.path."__getitem__"(0) = pClasspaths) { Quit }
+
+ while (sys.path."__contains__"(pClasspaths)) {
+ do sys.path.remove(pClasspaths)
160
}
+ do sys.path.insert(0, pClasspaths)
161
162
163
Method Connect() As %Status
0 commit comments