Skip to content

Commit

Permalink
NVDA helper and watchdog/Python 3: with file -> with open function. Re
Browse files Browse the repository at this point in the history
  • Loading branch information
josephsl committed Jun 4, 2019
1 parent 35f7975 commit 8076c2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion source/NVDAHelper.py
Expand Up @@ -412,7 +412,8 @@ def __init__(self):
pipeRead = self._duplicateAsInheritable(pipeReadOrig)
winKernel.closeHandle(pipeReadOrig)
# stdout/stderr of the loader process should go to nul.
with file("nul", "w") as nul:
# #9038 (Py3 review required): File() function is gone, replaced by open().
with open("nul", "w") as nul:
nulHandle = self._duplicateAsInheritable(msvcrt.get_osfhandle(nul.fileno()))
# Set the process to start with the appropriate std* handles.
si = winKernel.STARTUPINFO(dwFlags=winKernel.STARTF_USESTDHANDLES, hSTDInput=pipeRead, hSTDOutput=nulHandle, hSTDError=nulHandle)
Expand Down
3 changes: 2 additions & 1 deletion source/watchdog.py
Expand Up @@ -156,7 +156,8 @@ def _crashHandler(exceptionInfo):
# Write a minidump.
dumpPath = os.path.abspath(os.path.join(globalVars.appArgs.logFileName, "..", "nvda_crash.dmp"))
try:
with file(dumpPath, "w") as mdf:
# #9038 (Py3 review required): file() function is gone, replaced by open().
with open(dumpPath, "w") as mdf:
mdExc = MINIDUMP_EXCEPTION_INFORMATION(ThreadId=threadId,
ExceptionPointers=exceptionInfo, ClientPointers=False)
if not ctypes.windll.DbgHelp.MiniDumpWriteDump(
Expand Down

0 comments on commit 8076c2b

Please sign in to comment.