Skip to content

Commit 4d3c6de

Browse files
committed
fix: use list of dict keys to iterate, fix flake8 warnings
- py3 compatibility
1 parent 916aaa1 commit 4d3c6de

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

schema_salad/ref_resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ def _resolve_identity(self, document, loader, base_url):
685685
def _normalize_fields(self, document, loader):
686686
# type: (Dict[Text, Text], Loader) -> None
687687
# Normalize fields which are prefixed or full URIn to vocabulary terms
688-
for d in document:
688+
for d in list(document.keys()):
689689
d2 = loader.expand_url(d, u"", scoped_id=False, vocab_term=True)
690690
if d != d2:
691691
document[d2] = document[d]

schema_salad/schema.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@
99
import avro.schema
1010
from . import validate
1111
import json
12-
# import urlparse
12+
1313
from six.moves.urllib import parse
1414
import six
1515
import os
1616

17-
if six.PY3:
17+
if six.PY3:
1818
AvroSchemaFromJSONData = avro.schema.SchemaFromJSONData
19-
else:
19+
else:
2020
AvroSchemaFromJSONData = avro.schema.make_avsc_object
21-
2221

2322
from avro.schema import Names, SchemaParseException
2423
from . import ref_resolver

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@
4141
# install_requires.append("avro") # TODO: remove me once cwltool is
4242
# available in Debian Stable, Ubuntu 12.04 LTS
4343

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

4950
setup(name='schema-salad',

0 commit comments

Comments
 (0)