Closed DanCardin closed 7 years ago
Sorry for the delay. There's a special case for this if you use except ImportError:
, which is better to use and more common. You would otherwise mask exceptions that are caused by programming errors within the module if it does exist.
I don't want this plugin to be the syntax police, so I'll think about this for a bit. But, I'm torn because this could be annoying enough to keep people from doing this (which wasn't the intention) 😜
@blueyed WDYT?
I like that it is annoying somehow, but it should rather add a comment there then also.. ;)
And because of this it's probably better to special-case all except
lines.
The reasoning I was going with is that the gap would naturally exist if there's more code in the try
block. For example:
try:
import mod
mod.do_something()
except:
pass
But, I still don't want this plugin to be the syntax police, so I'll go ahead and have it close the gap. I want people to have the same rights that I have to shoot myself in the foot without everyone being all uppity about it.
@tweekmonster Understood. Thanks!
I would think should stay as-is, but gets transformed to