From 42d2fb1493453a33a9e5d64d37e1db79c5c2ef9f Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Fri, 26 Jul 2024 09:55:23 +0200 Subject: [PATCH] Remove references to Python2 copy-pasted from pitkajuh. See https://github.com/root-project/cling/pull/519 --- docs/conf.py | 1 - docs/tools/in2pod.py | 3 +-- test/lit.cfg | 8 +------- tools/Jupyter/kernel/clingkernel.py | 4 +--- tools/Jupyter/kernel/setup.py | 10 +++------- tools/packaging/cpt.py | 8 ++------ 6 files changed, 8 insertions(+), 26 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7186bb3fdf..74d23f124e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,7 +11,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -from __future__ import absolute_import, division, print_function import sys, os from datetime import date diff --git a/docs/tools/in2pod.py b/docs/tools/in2pod.py index 6a1b537d3e..4387609769 100644 --- a/docs/tools/in2pod.py +++ b/docs/tools/in2pod.py @@ -1,8 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # A tool to parse cling.pod.in and generate cling.pod dynamically -from __future__ import print_function import subprocess import sys import os diff --git a/test/lit.cfg b/test/lit.cfg index a1ba0d92b1..6f02a7fe14 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -13,13 +13,7 @@ from lit.llvm import llvm_config # Configuration file for the 'lit' test runner. -if sys.version_info < (3, 0): - # Python 2.x - from urllib2 import urlopen - input = raw_input -else: - # Python 3.x - from urllib.request import urlopen +from urllib.request import urlopen IsWindows = platform.system() == 'Windows' diff --git a/tools/Jupyter/kernel/clingkernel.py b/tools/Jupyter/kernel/clingkernel.py index a8f850b8d1..61cf6d6f97 100644 --- a/tools/Jupyter/kernel/clingkernel.py +++ b/tools/Jupyter/kernel/clingkernel.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #------------------------------------------------------------------------------ # CLING - the C++ LLVM-based InterpreterG :) # author: Min RK @@ -15,8 +15,6 @@ Talks to Cling via ctypes """ -from __future__ import print_function - __version__ = '0.0.3' import ctypes diff --git a/tools/Jupyter/kernel/setup.py b/tools/Jupyter/kernel/setup.py index 26d933f8ee..503d5f6118 100644 --- a/tools/Jupyter/kernel/setup.py +++ b/tools/Jupyter/kernel/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # coding: utf-8 #------------------------------------------------------------------------------ @@ -11,8 +11,6 @@ # LICENSE.TXT for details. #------------------------------------------------------------------------------ -from __future__ import print_function - # the name of the project name = 'clingkernel' @@ -23,13 +21,11 @@ import sys v = sys.version_info -if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)): - error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name +if v[0] >= 3 and v[:2] < (3,3): + error = "ERROR: %s requires Python version 3.3 or above." % name print(error, file=sys.stderr) sys.exit(1) -PY3 = (sys.version_info[0] >= 3) - #----------------------------------------------------------------------------- # get on with it #----------------------------------------------------------------------------- diff --git a/tools/packaging/cpt.py b/tools/packaging/cpt.py index e6ee249b92..18644f846d 100755 --- a/tools/packaging/cpt.py +++ b/tools/packaging/cpt.py @@ -21,10 +21,6 @@ import sys - -if sys.version_info < (3, 0): - raise Exception("cpt needs Python 3") - import argparse import copy import os @@ -100,7 +96,7 @@ def travis_fold_end(tag): def box_draw_header(): msg = 'cling (' + platform.machine() + ')' \ - + formatdate(time.time(), tzinfo()) + + formatdate(time.time(), tzinfo()) spaces_no = 80 - len(msg) - 4 spacer = ' ' * spaces_no msg = 'cling (' + platform.machine() + ')' \ @@ -1842,7 +1838,7 @@ def make_dmg(CPT_SRC_DIR): parser = argparse.ArgumentParser(description='Cling Packaging Tool') parser.add_argument('--last-stable-build', help='Build the last stable snapshot in one of these formats: tar | deb | nsis | rpm | dmg | pkg') -parser.add_argument('--current-dev-build', +parser.add_argument('--current-dev-build', help=('--current-dev: will build the latest development snapshot in the given format' + '\n--current-dev:branch: will build on llvm, clang, and cling' + '\n--current-dev:branches: will build branch on llvm, on clang, and on cling'))