Skip to content

Commit

Permalink
fix: use list of dict keys to iterate, fix flake8 warnings
Browse files Browse the repository at this point in the history
- py3 compatibility
  • Loading branch information
manu-chroma committed Jun 27, 2017
1 parent 916aaa1 commit 4d3c6de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion schema_salad/ref_resolver.py
Expand Up @@ -685,7 +685,7 @@ def _resolve_identity(self, document, loader, base_url):
def _normalize_fields(self, document, loader):
# type: (Dict[Text, Text], Loader) -> None
# Normalize fields which are prefixed or full URIn to vocabulary terms
for d in document:
for d in list(document.keys()):
d2 = loader.expand_url(d, u"", scoped_id=False, vocab_term=True)
if d != d2:
document[d2] = document[d]
Expand Down
7 changes: 3 additions & 4 deletions schema_salad/schema.py
Expand Up @@ -9,16 +9,15 @@
import avro.schema
from . import validate
import json
# import urlparse

from six.moves.urllib import parse
import six
import os

if six.PY3:
if six.PY3:
AvroSchemaFromJSONData = avro.schema.SchemaFromJSONData
else:
else:
AvroSchemaFromJSONData = avro.schema.make_avsc_object


from avro.schema import Names, SchemaParseException
from . import ref_resolver
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Expand Up @@ -41,9 +41,10 @@
# install_requires.append("avro") # TODO: remove me once cwltool is
# available in Debian Stable, Ubuntu 12.04 LTS

extras_require={ # TODO: uncomment me, same conditions as above
':python_version<"3"': ['avro'],
':python_version>="3"': ['avro-python3']}

extras_require={ # TODO: uncomment me, same conditions as above
':python_version<"3"': ['avro'],
':python_version>="3"': ['avro-python3']}
# extras_require = {} # TODO: to be removed when the above is added

setup(name='schema-salad',
Expand Down

0 comments on commit 4d3c6de

Please sign in to comment.