Skip to content

Commit de292f0

Browse files
authored
Merge pull request dropbox#182 from cakoose/py3
Make build and helper script work under Python 3.
2 parents 81c01e3 + 9e825cd commit de292f0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

generator/java.stoneg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@
4848
)
4949
from stone.backend import CodeBackend
5050

51+
@six.add_metaclass(abc.ABCMeta)
5152
class StoneType:
52-
__metaclass__ = abc.ABCMeta
53+
pass
5354

5455
StoneType.register(ApiNamespace)
5556
StoneType.register(ApiRoute)
@@ -2265,7 +2266,7 @@ def __str__(self):
22652266

22662267
def _as_json(self):
22672268
dct = {}
2268-
for k, v in self.__dict__.iteritems():
2269+
for k, v in self.__dict__.items():
22692270
# avoid cyclic references issue
22702271
if isinstance(v, JavaReference):
22712272
dct[k] = v.fq_name

scripts/export-generated

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def get_files_in_repo(repo_path, exclude_ignored_files=False):
7979
ignored_files = subprocess.check_output(command, cwd=repo_path).split()
8080
else:
8181
ignored_files = []
82-
return [file for file in files_list if file not in ignored_files]
82+
return [file.decode('utf8') for file in files_list if file not in ignored_files]
8383

8484
def strip_private_sections(path):
8585
"""Delete everything in the file between the private repo tags"""
@@ -121,7 +121,7 @@ def main():
121121
"""The entry point for the program."""
122122

123123
args = _cmdline_parser.parse_args()
124-
cwd = os.path.dirname(os.path.dirname(__file__))
124+
cwd = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
125125
repo_path = args.repo_path
126126
def log(msg):
127127
if args.verbose:

0 commit comments

Comments
 (0)