Merge pull request #237 from puremourning/neovim-exceptions

Fix neovim (again) - incompatible exception behaviour
This commit is contained in:
mergify[bot] 2020-08-24 17:43:03 +00:00 committed by GitHub
commit 3374d32891
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View file

@ -348,14 +348,11 @@ class ProjectBreakpoints( object ):
f"Invalid value for exception breakpoint filter '{f}': "
f"'{result}'. Must be boolean, 'Y', 'N' or '' (default)" )
else:
try:
result = utils.AskForInput(
"{}: Break on {} (Y/N/default: {})? ".format( f[ 'filter' ],
f[ 'label' ],
default_value ),
default_value )
except KeyboardInterrupt:
result = ''
result = utils.AskForInput(
"{}: Break on {} (Y/N/default: {})? ".format( f[ 'filter' ],
f[ 'label' ],
default_value ),
default_value )
if result == 'Y':
exception_filters.append( f[ 'filter' ] )

View file

@ -339,7 +339,7 @@ def SelectFromList( prompt, options ):
if selection < 0 or selection >= len( options ):
return None
return options[ selection ]
except KeyboardInterrupt:
except ( KeyboardInterrupt, vim.error ):
return None
@ -353,7 +353,7 @@ def AskForInput( prompt, default_value = None ):
try:
return vim.eval( "input( '{}' {} )".format( Escape( prompt ),
default_option ) )
except KeyboardInterrupt:
except ( KeyboardInterrupt, vim.error ):
return None
@ -732,7 +732,7 @@ def GetVimValue( vim_dict, name, default=None ):
# FIXME: use 'encoding' ?
try:
value = vim_dict[ name ]
except KeyError:
except ( KeyError, vim.error ):
return default
if isinstance( value, bytes ):
@ -743,7 +743,7 @@ def GetVimValue( vim_dict, name, default=None ):
def GetVimList( vim_dict, name, default=None ):
try:
value = vim_dict[ name ]
except KeyError:
except ( KeyError, vim.error ):
return default
if not isinstance( value, collections.abc.Iterable ):