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

Skip to content

Commit 99ec5a5

Browse files
author
Just van Rossum
committed
Add $(APPLICATION) or :Mac:Tools:IDE at the very start of sys.path to improve startup time -- jvr
1 parent a7a7193 commit 99ec5a5

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Mac/Tools/IDE/PythonIDE.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ def init():
2020
# we're not an applet
2121
Res.OpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:PythonIDE.rsrc"))
2222
Res.OpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc"))
23-
sys.path.append(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE"))
23+
ide_path = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE")
2424
else:
2525
# we're an applet
2626
try:
2727
Res.GetResource('CURS', 468)
2828
except Res.Error:
2929
Res.OpenResFile(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE:Widgets.rsrc"))
30-
sys.path.append(os.path.join(sys.exec_prefix, ":Mac:Tools:IDE"))
30+
ide_path = os.path.join(sys.exec_prefix, ":Mac:Tools:IDE")
3131
else:
3232
# we're a full blown applet
33-
if sys.argv[0] not in sys.path:
34-
sys.path[2:2] = [sys.argv[0]]
33+
ide_path = sys.argv[0]
34+
if ide_path not in sys.path:
35+
sys.path.insert(0, ide_path)
3536

3637

3738
init()

0 commit comments

Comments
 (0)