[pypy-commit] pypy winconsoleio: help flow analysis

mattip pypy.commits at gmail.com
Wed Sep 18 08:40:05 EDT 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: winconsoleio
Changeset: r97524:758dcf8d6170
Date: 2019-09-18 15:39 +0300
http://bitbucket.org/pypy/pypy/changeset/758dcf8d6170/

Log:	help flow analysis

diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py
--- a/pypy/module/_io/interp_win32consoleio.py
+++ b/pypy/module/_io/interp_win32consoleio.py
@@ -201,6 +201,9 @@
             if space.isinstance_w(w_nameobj, space.w_int): 
                 self.fd = space.int_w(w_nameobj)
 
+            # make the flow analysis happy,otherwise it thinks w_path
+            # is undefined later
+            w_path = w_nameobj
             if self.fd < 0:
                 from pypy.module.posix.interp_posix import fspath
                 w_path = fspath(space, w_nameobj)


More information about the pypy-commit mailing list