Skip to content

Commit 3bfe919

Browse files
committed
add Python 3 support
1 parent 258adfc commit 3bfe919

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

cwlupgrader/main.py

100644100755
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from __future__ import print_function
1+
#!/usr/bin/env python
2+
3+
from __future__ import print_function, unicode_literals
24
import ruamel.yaml
35
from typing import Any, Dict
46
from collections import Mapping, Sequence
@@ -70,21 +72,21 @@ def setupCLTMappings(document): # type: (Dict[unicode, Any]) -> None
7072

7173
def shortenType(typeObj):
7274
# type: (List[Any]) -> Union[Unicode, List[Any]]
73-
if isinstance(typeObj, (str, unicode)) or not isinstance(typeObj, Sequence):
75+
if isinstance(typeObj, str) or not isinstance(typeObj, Sequence):
7476
return typeObj
7577
newType = []
7678
for entry in typeObj: # find arrays that we can shorten and do so
7779
if isinstance(entry, Mapping):
7880
if (entry['type'] == 'array' and
79-
isinstance(entry['items'], (str, unicode))):
81+
isinstance(entry['items'], str)):
8082
entry = entry['items'] + '[]'
8183
newType.extend([entry])
8284
typeObj = newType
8385
if len(typeObj) == 2:
8486
if 'null' in typeObj:
8587
typeCopy = copy.deepcopy(typeObj)
8688
typeCopy.remove('null')
87-
if isinstance(typeCopy[0], (str, unicode)):
89+
if isinstance(typeCopy[0], str):
8890
return typeCopy[0] + '?'
8991
return typeObj
9092

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
README = os.path.join(SETUP_DIR, 'README.rst')
1111

1212
setup(name='cwl-upgrader',
13-
version='0.2',
13+
version='0.2.1',
1414
description='Common Workflow Language standalone document upgrader',
1515
long_description=open(README).read(),
1616
author='Common Workflow Language contributors',

0 commit comments

Comments
 (0)