Skip to content

Commit

Permalink
Merge pull request #8 from AbigailBuccaneer/python3
Browse files Browse the repository at this point in the history
Fix Python 3 support
  • Loading branch information
AbigailBuccaneer authored Dec 16, 2017
2 parents 0ac5622 + 618702b commit 0315496
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "nightly"
install:
- pip install pipenv pew
- pipenv install --dev --ignore-pipfile
Expand Down
9 changes: 7 additions & 2 deletions json2cmake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
import shlex
import uuid

try:
basestring
except NameError:
basestring = str


def freeze(obj):
if isinstance(obj, dict):
return freeze(set([freeze(x) for x in obj.iteritems()]))
return freeze(set([freeze(x) for x in obj.items()]))
if isinstance(obj, list):
return tuple([freeze(x) for x in obj])
if isinstance(obj, set):
Expand Down Expand Up @@ -90,7 +95,7 @@ def write(self, output, directory=None):
output.write('cmake_minimum_required(VERSION 2.8.8)\n')
output.write('project(autogenerated)\n\n')

for (config, files) in self.targets.iteritems():
for (config, files) in self.targets.items():
config = {k: v for (k, v) in config}
name = uuid.uuid4()

Expand Down

0 comments on commit 0315496

Please sign in to comment.