From 424c7b69dbccf842a6921a118ac769134b41497f Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sun, 19 Nov 2017 18:30:21 +0100 Subject: [PATCH] Fix wscript to support both Python 2 and Python 3. --- wscript | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index e2dd3d7f..ce60a1ed 100644 --- a/wscript +++ b/wscript @@ -1,8 +1,11 @@ #! /usr/bin/env python # encoding: utf-8 -from urllib2 import urlopen # Python 2 -# from urllib.request import urlopen # Python 3 +try: + from urllib2 import urlopen # Python 2 +except ImportError: + from urllib.request import urlopen # Python 3 + import os.path from subprocess import call import sys