Skip to content

Commit 2d906ce

Browse files
committed
Fix paths.
1 parent 10b618b commit 2d906ce

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

autoload/pymode/virtualenv.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ fun! pymode#virtualenv#Activate() "{{{
1313
call add(g:pymode_virtualenv_enabled, $VIRTUAL_ENV)
1414

1515
python << EOF
16+
import sys, vim, os
17+
1618
ve_dir = os.environ['VIRTUAL_ENV']
1719
ve_dir in sys.path or sys.path.insert(0, ve_dir)
1820
activate_this = os.path.join(os.path.join(ve_dir, 'bin'), 'activate_this.py')

plugin/pymode.vim

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,6 @@ if !has('python')
1919
let g:pymode_virtualenv = 0
2020
endif
2121

22-
" DESC: Fix python path
23-
if !pymode#Default('g:pymode_path', 1) || g:pymode_path
24-
python << EOF
25-
import sys, vim, os, StringIO
26-
27-
curpath = vim.eval("getcwd()")
28-
libpath = os.path.join(os.path.dirname(os.path.dirname(
29-
vim.eval("expand('<sfile>:p')"))), 'pylibs')
30-
31-
sys.path = [libpath, curpath] + sys.path
32-
EOF
33-
endif
34-
3522

3623
" Virtualenv {{{
3724

@@ -47,6 +34,20 @@ endif
4734
" }}}
4835

4936

37+
" DESC: Fix python path
38+
if !pymode#Default('g:pymode_path', 1) || g:pymode_path
39+
python << EOF
40+
import sys, vim, os
41+
42+
curpath = vim.eval("getcwd()")
43+
libpath = os.path.join(os.path.dirname(os.path.dirname(
44+
vim.eval("expand('<sfile>:p')"))), 'pylibs')
45+
46+
sys.path = [libpath, curpath] + sys.path
47+
EOF
48+
endif
49+
50+
5051
" Lint {{{
5152

5253
if !pymode#Default("g:pymode_lint", 1) || g:pymode_lint

0 commit comments

Comments
 (0)