File Switch-to-Python-3.patch of Package winexe

From: Sophie Brun <sophie@offensive-security.com>
Date: Mon, 7 Oct 2019 16:20:42 +0200
Subject: Switch to Python 3

Gpq Pq: Name switch-to-python3.patch
Last-Update: 2019-10-07
---
 source/smb_static/wscript       |   4 ++--
 source/smb_static/wscript_build |   2 +-
 source/waf                      | Bin 89470 -> 89466 bytes
 source/wscript                  |   2 +-
 source/wscript_build            |   2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/source/smb_static/wscript b/source/smb_static/wscript
index 44bd2e8..bc51a8f 100644
--- a/source/smb_static/wscript
+++ b/source/smb_static/wscript
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import sys, os
 
@@ -13,7 +13,7 @@ except:
 os.symlink(SAMBA_DIR + '/' + LOCK_FILE, LOCK_FILE)
 
 os.chdir(SAMBA_DIR)
-execfile("wscript")
+exec(compile(open("wscript", "rb").read(), "wscript", 'exec'))
 Options.launch_dir = os.getcwd()
 Options.SCRIPT_DIR = SCRIPT_DIR
 Options.BUILD_DIR = Options.SCRIPT_DIR + '/build'
diff --git a/source/smb_static/wscript_build b/source/smb_static/wscript_build
index 89ba3c4..44dd110 100644
--- a/source/smb_static/wscript_build
+++ b/source/smb_static/wscript_build
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import os,sys
 from samba_utils import *
diff --git a/source/waf b/source/waf
index 2aa2146..4b43845 100755
--- a/source/waf
+++ b/source/waf
@@ -111,7 +111,7 @@ def unpack_wafdir(dir):
 	os.unlink(tmp)
 	os.chdir(cwd)
 
-	try: dir = unicode(dir, 'mbcs')
+	try: dir = str(dir, 'mbcs')
 	except: pass
 	try:
 		from ctypes import windll
diff --git a/source/wscript b/source/wscript
index 97c9b35..d5eddd6 100644
--- a/source/wscript
+++ b/source/wscript
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import os
 
diff --git a/source/wscript_build b/source/wscript_build
index 68612f3..aa76be1 100644
--- a/source/wscript_build
+++ b/source/wscript_build
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 bld.install_files('${PREFIX}/share/man/man1', 'winexe.1')
 
openSUSE Build Service is sponsored by