Skip to content

Commit

Permalink
Futurising validation test
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveyBiggers committed Sep 22, 2017
1 parent 8b6c559 commit 36c66df
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sample_missions/validate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
# ------------------------------------------------------------------------------------------------
# Copyright (c) 2016 Microsoft Corporation
#
Expand All @@ -20,14 +21,14 @@
import sys

if not len(sys.argv) == 2:
print '\nA utility script that takes a filename argument and attempts to validate it as a valid mission file.'
print '\nUsage:\n\npython', sys.argv[0], 'file_to_validate.xml\n'
print('\nA utility script that takes a filename argument and attempts to validate it as a valid mission file.')
print('\nUsage:\n\npython', sys.argv[0], 'file_to_validate.xml\n')
exit(1)

try:
import MalmoPython
except:
print '\nError: Requires the MalmoPython module to be present in the python path or the current directory.\n'
print('\nError: Requires the MalmoPython module to be present in the python path or the current directory.\n')
exit(1)

filename = sys.argv[1]
Expand All @@ -36,7 +37,7 @@
try:
MalmoPython.MissionSpec( xml_string, True )
except RuntimeError as e:
print 'Error validating',filename,':',e
print('Error validating',filename,':',e)
exit(1)

print filename,'validated correctly.'
print(filename,'validated correctly.')

0 comments on commit 36c66df

Please sign in to comment.