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 11# Copyright 2017 Palantir Technologies, Inc.
22import logging
33import pycodestyle
4- from autopep8 import continued_indentation as autopep8_c_i
54from pyls import hookimpl , lsp
65
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 )
1317
1418log = logging .getLogger (__name__ )
1519
You can’t perform that action at this time.
0 commit comments