Skip to content

Commit 590c377

Browse files
committed
Further fixes for running under py3
1 parent ccab213 commit 590c377

File tree

1 file changed

+9
-9
lines changed
  • pythonforandroid/bootstraps/pygame/build

1 file changed

+9
-9
lines changed

pythonforandroid/bootstraps/pygame/build/build.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def render(template, dest, **kwargs):
6868
template = environment.get_template(template)
6969
text = template.render(**kwargs)
7070

71-
f = file(dest, 'wb')
71+
f = open(dest, 'wb')
7272
f.write(text.encode('utf-8'))
7373
f.close()
7474

@@ -224,9 +224,9 @@ def make_package(args):
224224

225225
args.numeric_version = str(version_code)
226226

227-
args.name = args.name.decode('utf-8')
228-
if args.icon_name:
229-
args.icon_name = args.icon_name.decode('utf-8')
227+
# args.name = args.name.decode('utf-8')
228+
# if args.icon_name:
229+
# args.icon_name = args.icon_name.decode('utf-8')
230230

231231
versioned_name = (args.name.replace(' ', '').replace('\'', '') +
232232
'-' + args.version)
@@ -306,8 +306,8 @@ def make_package(args):
306306
subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t',
307307
'android-{}'.format(args.sdk_version)])
308308
except (OSError, IOError):
309-
print 'An error occured while calling', ANDROID, 'update'
310-
print 'Your PATH must include android tools.'
309+
print('An error occured while calling', ANDROID, 'update')
310+
print('Your PATH must include android tools.')
311311
sys.exit(-1)
312312

313313
# Delete the old assets.
@@ -346,7 +346,7 @@ def make_package(args):
346346
if args.add_jar:
347347
for jarname in args.add_jar:
348348
if not os.path.exists(jarname):
349-
print 'Requested jar does not exist: {}'.format(jarname)
349+
print('Requested jar does not exist: {}'.format(jarname))
350350
sys.exit(-1)
351351
shutil.copy(jarname, 'libs')
352352

@@ -355,8 +355,8 @@ def make_package(args):
355355
for arg in args.command:
356356
subprocess.check_call([ANT, arg])
357357
except (OSError, IOError):
358-
print 'An error occured while calling', ANT
359-
print 'Did you install ant on your system ?'
358+
print('An error occured while calling', ANT)
359+
print('Did you install ant on your system ?')
360360
sys.exit(-1)
361361

362362
def parse_args(args=None):

0 commit comments

Comments
 (0)