remove some try/except
This commit is contained in:
@ -885,10 +885,7 @@ class SymLinkOption(OnlyOption):
|
||||
return self._impl_getopt().impl_is_multi()
|
||||
|
||||
def _is_subdyn(self):
|
||||
try:
|
||||
return self._impl_getopt()._subdyn is not None
|
||||
except AttributeError:
|
||||
return False
|
||||
return getattr(self._impl_getopt(), '_subdyn', None) is not None
|
||||
|
||||
|
||||
class DynSymLinkOption(object):
|
||||
|
@ -143,12 +143,9 @@ class MasterSlaves(object):
|
||||
if index is None and validate is True:
|
||||
masterlen = len(value)
|
||||
for slave in self.getslaves(opt):
|
||||
try:
|
||||
slave_path = slave.impl_getpath(values._getcontext())
|
||||
slavelen = values._p_.get_max_length(slave_path)
|
||||
self.validate_slave_length(masterlen, slavelen, slave.impl_getname(), opt)
|
||||
except ConfigError: # pragma: optional cover
|
||||
pass
|
||||
slave_path = slave.impl_getpath(values._getcontext())
|
||||
slavelen = values._p_.get_max_length(slave_path)
|
||||
self.validate_slave_length(masterlen, slavelen, slave.impl_getname(), opt)
|
||||
return value
|
||||
|
||||
def _getslave(self, values, opt, path, validate, force_permissive,
|
||||
@ -185,12 +182,14 @@ class MasterSlaves(object):
|
||||
multi = values._get_multi(opt, path)
|
||||
if masterlen == 0:
|
||||
if validate_properties:
|
||||
context.cfgimpl_get_settings().validate_properties(opt, False,
|
||||
False,
|
||||
value=multi,
|
||||
path=path,
|
||||
force_permissive=force_permissive,
|
||||
setting_properties=setting_properties)
|
||||
props = context.cfgimpl_get_settings().validate_properties(opt, False,
|
||||
False,
|
||||
value=multi,
|
||||
path=path,
|
||||
force_permissive=force_permissive,
|
||||
setting_properties=setting_properties)
|
||||
if props:
|
||||
raise props
|
||||
else:
|
||||
one_has_value = False
|
||||
if index is None:
|
||||
|
Reference in New Issue
Block a user