From 8d6c75530755e3ce95628a573e2cc1fa363fd241 Mon Sep 17 00:00:00 2001 From: Sergio Date: Mon, 23 Sep 2024 11:58:12 +0200 Subject: [PATCH] Remove python2 support in imports We don't use python2 anywhere anymore, and these imports are tough to analize for LSP (694396ea0b923a52dab72fe3c643e634e4b44e41) --- analytics/report-analytics | 8 ++------ ci/sync-mapusers.py | 5 +---- report-pr-errors | 5 +---- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/analytics/report-analytics b/analytics/report-analytics index 5e4c8c8e..8d9c4d53 100755 --- a/analytics/report-analytics +++ b/analytics/report-analytics @@ -4,12 +4,8 @@ import argparse import os import subprocess import sys -try: - from commands import getstatusoutput - from urllib import urlopen -except ImportError: - from subprocess import getstatusoutput - from urllib.request import urlopen +from subprocess import getstatusoutput +from urllib.request import urlopen def python_version(): diff --git a/ci/sync-mapusers.py b/ci/sync-mapusers.py index b14f54ae..7882d07e 100755 --- a/ci/sync-mapusers.py +++ b/ci/sync-mapusers.py @@ -3,10 +3,7 @@ from requests import get from random import choice import yaml,sys -try: - from urlparse import urlsplit,urlunsplit -except ImportError: - from urllib.parse import urlsplit,urlunsplit +from urllib.parse import urlsplit,urlunsplit url = sys.argv[1] mesos_dns = "leader.mesos:8123" diff --git a/report-pr-errors b/report-pr-errors index 182201f3..37538105 100755 --- a/report-pr-errors +++ b/report-pr-errors @@ -2,10 +2,7 @@ from __future__ import print_function from argparse import ArgumentParser, Namespace -try: - from commands import getstatusoutput -except ImportError: - from subprocess import getstatusoutput +from subprocess import getstatusoutput from collections import deque from fnmatch import fnmatch from glob import glob