$OpenBSD: patch-build_tap-driver,v 1.1 2016/04/16 08:18:27 ajacoutot Exp $

From d50dbae41ef973b0a858dbda5db91b8658787f3b Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
Date: Wed, 6 Apr 2016 10:37:38 +0200
Subject: build: Port to Python 3

--- build/tap-driver.orig	Tue Sep 23 09:49:21 2014
+++ build/tap-driver	Sat Apr 16 10:14:16 2016
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Copyright (C) 2013 Red Hat, Inc.
 #
@@ -102,7 +102,7 @@ class Driver:
             proc = subprocess.Popen(self.argv, close_fds=True,
                                     stdout=subprocess.PIPE,
                                     stderr=subprocess.PIPE)
-        except OSError, ex:
+        except OSError as ex:
             self.report_error("Couldn't run %s: %s" % (self.argv[0], str(ex)))
             return
 
@@ -112,13 +112,13 @@ class Driver:
         while len(rset) > 0:
             ret = select.select(rset, [], [], 10)
             if outf in ret[0]:
-                data = os.read(outf, 1024)
+                data = os.read(outf, 1024).decode("utf-8")
                 if data == "":
                     rset.remove(outf)
                 self.log.write(data)
                 self.process(data)
             if errf in ret[0]:
-                data = os.read(errf, 1024)
+                data = os.read(errf, 1024).decode("utf-8")
                 if data == "":
                     rset.remove(errf)
                 self.log.write(data)
