mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-13 08:04:18 +00:00
Use try/except/else to disable demandimport
This commit is contained in:
parent
45c7138907
commit
c1db99e4f2
1 changed files with 2 additions and 1 deletions
|
|
@ -2,9 +2,10 @@
|
||||||
try:
|
try:
|
||||||
# The 'demandimport' breaks pyflakes and flake8._pyflakes
|
# The 'demandimport' breaks pyflakes and flake8._pyflakes
|
||||||
from mercurial import demandimport
|
from mercurial import demandimport
|
||||||
demandimport.disable()
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
else:
|
||||||
|
demandimport.disable()
|
||||||
import pyflakes
|
import pyflakes
|
||||||
import pyflakes.checker
|
import pyflakes.checker
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue