Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit30d83ba

Browse files
committed
Add submodules's path to sys.path for windows platformpython-mode#852 with corrections
1 parent7e43337 commit30d83ba

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

‎pymode/utils.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
"""Pymode utils."""
1+
"""Pymode utils."""
22
importos.path
33
importsys
44
importthreading
55
importwarnings
66
fromcontextlibimportcontextmanager
77

8-
importvim# noqa
8+
importvim# noqa
99
from ._compatimportStringIO
1010

1111

@@ -16,7 +16,7 @@
1616

1717
@contextmanager
1818
defsilence_stderr():
19-
"""Redirect stderr."""
19+
"""Redirect stderr."""
2020
ifDEBUG:
2121
yield
2222

@@ -36,4 +36,13 @@ def patch_paths():
3636
3737
Load required modules from the plugin's sources.
3838
"""
39-
sys.path.insert(0,os.path.join(os.path.dirname(__file__),'libs'))
39+
dir_script=os.path.dirname(os.path.abspath(__file__))
40+
sys.path.insert(0,os.path.join(dir_script,'libs'))
41+
ifsys.platform=='win32':
42+
dir_submodule=os.path.abspath(os.path.join(dir_script,
43+
'..','submodules'))
44+
sub_modules=os.listdir(dir_submodule)
45+
formoduleinsub_modules:
46+
module_full_path=os.path.join(dir_submodule,module)
47+
ifmodule_full_pathnotinsys.path:
48+
sys.path.insert(0,module_full_path)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp