File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
1
# Copyright 2017 Palantir Technologies, Inc.
2
2
import logging
3
3
import pycodestyle
4
- from autopep8 import continued_indentation as autopep8_c_i
5
4
from pyls import hookimpl , lsp
6
5
7
- # Check if autopep8's continued_indentation implementation
8
- # is overriding pycodestyle's and if so, re-register
9
- # the check using pycodestyle's implementation as expected
10
- if autopep8_c_i in pycodestyle ._checks ['logical_line' ]:
11
- del pycodestyle ._checks ['logical_line' ][autopep8_c_i ]
12
- pycodestyle .register_check (pycodestyle .continued_indentation )
6
+ try :
7
+ from autopep8 import continued_indentation as autopep8_c_i
8
+ except ImportError :
9
+ pass
10
+ else :
11
+ # Check if autopep8's continued_indentation implementation
12
+ # is overriding pycodestyle's and if so, re-register
13
+ # the check using pycodestyle's implementation as expected
14
+ if autopep8_c_i in pycodestyle ._checks ['logical_line' ]:
15
+ del pycodestyle ._checks ['logical_line' ][autopep8_c_i ]
16
+ pycodestyle .register_check (pycodestyle .continued_indentation )
13
17
14
18
log = logging .getLogger (__name__ )
15
19
You can’t perform that action at this time.
0 commit comments