From 616c2b04a39e84564ee20be318b68624a83efa4b Mon Sep 17 00:00:00 2001 From: cclauss Date: Fri, 2 Mar 2018 10:48:48 +0100 Subject: [PATCH] reload() was moved into importlib in Python 3 The builtin __reload()__ was moved into [importlib](https://docs.python.org/3/library/importlib.html#importlib.reload) in Python 3 because it was being overused and led to odd behavior that was often difficult to diagnose. Here we are trying to __reload(sys)__ probably because 'utf-8' encoding and Unicode strs are not the default in Python 2. They are however the default in Python 3 so this PR therefor suggests that a __pass__ would be satisfactory in Python 3. --- ci/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ci/main.py b/ci/main.py index 2e2f97e..504d41a 100644 --- a/ci/main.py +++ b/ci/main.py @@ -4,10 +4,11 @@ import json, sys import sqlite3 from collections import OrderedDict - -reload(sys) -sys.setdefaultencoding('utf-8') - +try: # Python 2 + reload(sys) + sys.setdefaultencoding('utf-8') +except NameError: # Python 3 + pass c = sqlite3.connect('ci.db')