Bug 1611298 - Fix TypeError in |./mach addtest|. r=firefox-build-system-reviewers,rstewart

Differential Revision: https://phabricator.services.mozilla.com/D60913

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Chris Manchester 2020-01-23 22:46:24 +00:00
parent 3c0ff11f59
commit 8f676d8627

View File

@ -139,6 +139,7 @@ class AddTest(MachCommandBase):
def addtest(self, suite=None, test=None, doc=None, overwrite=False,
editor=MISSING_ARG, **kwargs):
import addtest
import io
from moztest.resolve import TEST_SUITES
if not suite and not test:
@ -205,7 +206,7 @@ class AddTest(MachCommandBase):
except OSError:
pass
with open(path, "w", newline='\n') as f:
with io.open(path, "w", newline='\n') as f:
f.write(template)
else:
# write to stdout if you passed only suite and doc and not a file path