From 7ef0c58c53e5a65609bc32f0c59843f023a1bf65 Mon Sep 17 00:00:00 2001 From: michaelcroquette <45485610+michaelcroquette@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:22:39 +0100 Subject: [PATCH] remove python 2 compatibility --- pyrpl/pyrpl.py | 14 ++++---------- pyrpl/widgets/spinbox.py | 6 ++---- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/pyrpl/pyrpl.py b/pyrpl/pyrpl.py index 12b6f1768..7e410ee98 100644 --- a/pyrpl/pyrpl.py +++ b/pyrpl/pyrpl.py @@ -166,16 +166,10 @@ from . import user_config_dir from ._version import __version__ -# input is the wrong function in python 2 -try: - raw_input -except NameError: # Python 3 - raw_input = input - -try: - basestring # in python 2 -except: - basestring = (str, bytes) + +raw_input = input + +basestring = (str, bytes) default_pyrpl_config = {'name': 'default_pyrpl_instance', diff --git a/pyrpl/widgets/spinbox.py b/pyrpl/widgets/spinbox.py index 5f7476317..18f4a9919 100644 --- a/pyrpl/widgets/spinbox.py +++ b/pyrpl/widgets/spinbox.py @@ -4,10 +4,8 @@ import logging import sys -if sys.version_info < (3,): - integer_types = (int, long) -else: - integer_types = (int,) + +integer_types = (int,) class NumberSpinBox(QtWidgets.QWidget):