Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def mode(self, value):
if value is None:
return
if type(value) in string_types:
value = Mode.for_string(value)
if Mode.is_mode(value):
# if value is not self.mode_t:
self.set_mode_t(value)
else:
raise TypeError("invalid mode type: %s (%s)" % (type(value), value))
def set(self, value):
if value is None:
self.value = value
return
if type(value) in string_types:
value = Mode.for_string(value)
if Mode.is_mode(value):
if value is not self.default:
self.value = value
return
else:
raise TypeError("can’t set invalid mode: %s (%s)" % (type(value), value))
@property
def string_types(self):
return tuple()
six = FakeSix()
export(wrap_value, name='wrap_value')
export(none_function, name='none_function')
export(tuplize, name='tuplize')
export(uniquify, name='uniquify')
export(listify, name='listify')
export(SimpleNamespace)
export(Namespace)
export(stringify, name='stringify')
export(string_types)
export(byte_types)
export(suffix_searcher)
export(u8encode)
export(u8bytes)
export(u8str)
# Assign the modules’ `__all__` and `__dir__` using the exporter:
__all__, __dir__ = exporter.all_and_dir()