From 378bb75bf8ca2d80a35e243bffefa8bb56e539be Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 7 Jan 2019 09:09:26 +0100 Subject: [PATCH] Use feature detection instead of version detection Follows the Python porting best practice [__use feature detection instead of version detection__](https://docs.python.org/3/howto/pyporting.html#use-feature-detection-instead-of-version-detection). --- init/select_ticket_info.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init/select_ticket_info.py b/init/select_ticket_info.py index 03abc41..455eb38 100755 --- a/init/select_ticket_info.py +++ b/init/select_ticket_info.py @@ -30,9 +30,12 @@ from myException.ticketIsExitsException import ticketIsExitsException from myException.ticketNumOutException import ticketNumOutException from myUrllib.httpUtils import HTTPClient from utils.timeUtil import time_to_minutes, minutes_to_time -if sys.version_info.major == 2: + +try: reload(sys) sys.setdefaultencoding('utf-8') +except NameError: + pass class select: