[jhbuild] Make sure we are running under Python 3



commit 76f1a8b24c7d41fc19e834146dc4690ae538e129
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Wed Jul 1 09:39:21 2020 +0200

    Make sure we are running under Python 3

 jhbuild/__init__.py        | 6 ++----
 jhbuild/defaults.jhbuildrc | 2 ++
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/jhbuild/__init__.py b/jhbuild/__init__.py
index 8ea1f065..3e22d033 100644
--- a/jhbuild/__init__.py
+++ b/jhbuild/__init__.py
@@ -18,10 +18,8 @@
 # We used to import pygtk which sets things to utf-8 and masks ascii encoding errors.
 # It's usually what we want, and there are not many downsides, so replicate it here.
 import sys
-if sys.version_info[0] == 2:
-    import __builtin__
-    __builtin__.reload(sys)
-    sys.setdefaultencoding("utf-8")
+
+assert sys.version_info[0] == 3, "JHBuild requires Python 3"
 
 from jhbuild import monkeypatch
 del monkeypatch
diff --git a/jhbuild/defaults.jhbuildrc b/jhbuild/defaults.jhbuildrc
index 097dd1ba..64c644f5 100644
--- a/jhbuild/defaults.jhbuildrc
+++ b/jhbuild/defaults.jhbuildrc
@@ -4,6 +4,8 @@
 
 import os, sys, tempfile
 
+assert sys.version_info[0] == 3, "JHBuild requires Python 3"
+
 if 'GTK_PATH' in os.environ.keys():
     del os.environ['GTK_PATH']
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]