Skip to content

Commit

Permalink
Python 3: file() -> open()
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Oct 21, 2017
1 parent 602401b commit 30b5103
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/zope/app/server/tests/test_mkzopeinstance.py
Expand Up @@ -381,9 +381,8 @@ def test_zope_namespace_package_doesnt_affect_software_home(self):

# place a test file into the skeleton dir that'll be expanded
# to SOFTWARE_HOME by mkzopeinstance
f = file(os.path.join(self.skeleton, 'test.in'), 'w')
f.write('<<SOFTWARE_HOME>>')
f.close()
with open(os.path.join(self.skeleton, 'test.in'), 'w') as f:
f.write('<<SOFTWARE_HOME>>')

# run mkzopeinstance
options = self.createOptions()
Expand All @@ -397,8 +396,8 @@ def test_zope_namespace_package_doesnt_affect_software_home(self):
import zope.app.server
expected = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(zope.app.server.__file__))))
self.assertEqual(file(os.path.join(self.instance, 'test')).read(),
expected)
with open(os.path.join(self.instance, 'test')) as f:
self.assertEqual(f.read(), expected)

# cleanup the fake 'zope' module
if old_path is None:
Expand Down

0 comments on commit 30b5103

Please sign in to comment.