Signed-off-by: Stephen Finucane <step...@that.guru>
---
 python/setup.py.template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/python/setup.py.template b/python/setup.py.template
index abd5e57b9..9e2df0dce 100644
--- a/python/setup.py.template
+++ b/python/setup.py.template
@@ -11,6 +11,7 @@
 # limitations under the License.
 
 import os
+import os.path
 import sys
 
 from setuptools.command.build_ext import build_ext
@@ -26,10 +27,7 @@ import setuptools
 VERSION = "@VERSION@"
 
 for x in ("version.py", "dirs.py"):
-    try:
-        # Try to open generated ovs/{version,dirs}.py
-        open(f"ovs/{x}")
-    except IOError:
+    if not os.path.exists(f"ovs/{x}"):
         print(f"Ensure {x} is created by running make python/ovs/{x}",
               file=sys.stderr)
         sys.exit(-1)
-- 
2.49.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to