replace file() with open() for python 3 compatibility

The built-in name 'file' does not exist under python 3, so replace it
with 'open', which is the same under python 2 and 3.

Change-Id: Ic1ff9308b1ab0bda8d49a556620bb22ca5407b5e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-06-06 16:59:04 -04:00
parent 290fc69953
commit e567904491
1 changed files with 1 additions and 1 deletions

View File

@ -136,7 +136,7 @@ class ForkedPdb(pdb.Pdb):
def interaction(self, *args, **kwargs):
_stdin = sys.stdin
try:
sys.stdin = file('/dev/stdin')
sys.stdin = open('/dev/stdin', 'r')
pdb.Pdb.interaction(self, *args, **kwargs)
finally:
sys.stdin = _stdin