Remove bad raise

This commit is contained in:
Pedro Algarvio 2015-08-05 16:35:43 +01:00
parent 16471cdfa0
commit aadb4ecc90
2 changed files with 15 additions and 1 deletions

View File

@ -789,7 +789,6 @@ def shutdown_multiprocessing_logging_listener():
try:
# Sent None sentinel to stop the logging processing queue
__MP_LOGGING_QUEUE.put(None)
raise
# Let's join the multiprocessing logging handle thread
__MP_LOGGING_QUEUE_PROCESS.join(1)
except IOError:

View File

@ -630,6 +630,21 @@ class Schema(six.with_metaclass(SchemaMeta, object)):
serialized['additionalProperties'] = cls.__allow_additional_items__
return serialized
@classmethod
def defaults(cls):
serialized = cls.serialize()
defaults = {}
for name, details in serialized['properties'].items():
if 'default' in details:
defaults[name] = details['default']
continue
if 'properties' in details:
for sname, sdetails in details['properties'].items():
if 'default' in sdetails:
defaults.setdefault(name, {})[sname] = sdetails['default']
continue
return defaults
@classmethod
def as_requirements_item(cls):
serialized_schema = cls.serialize()