From c2a9dcfc3bd1c95e9046370ead0dded70b72f35d Mon Sep 17 00:00:00 2001 From: Alexandre Detiste Date: Mon, 18 Nov 2024 14:28:05 +0100 Subject: [PATCH] trim Python2 cruft --- periodictable/activation.py | 4 +--- periodictable/core.py | 1 - periodictable/formulas.py | 1 - periodictable/nsf.py | 1 - periodictable/util.py | 7 ++----- 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/periodictable/activation.py b/periodictable/activation.py index 87b8e67..78f504e 100644 --- a/periodictable/activation.py +++ b/periodictable/activation.py @@ -73,8 +73,6 @@ http://cds.cern.ch/record/111089/files/IAEA-TR-273.pdf """ -from __future__ import division, print_function - from math import exp, log, expm1 import os @@ -108,7 +106,7 @@ def IAEA1987_isotopic_abundance(iso): except AttributeError: return 0 -class Sample(object): +class Sample: """ Sample properties. diff --git a/periodictable/core.py b/periodictable/core.py index 915b9f9..0bb34c1 100644 --- a/periodictable/core.py +++ b/periodictable/core.py @@ -55,7 +55,6 @@ periodic table with custom values for the attributes. """ -from __future__ import print_function __docformat__ = 'restructuredtext en' __all__ = ['delayed_load', 'define_elements', 'get_data_path', diff --git a/periodictable/formulas.py b/periodictable/formulas.py index 2c795f6..8e84b0d 100644 --- a/periodictable/formulas.py +++ b/periodictable/formulas.py @@ -3,7 +3,6 @@ """ Chemical formula parser. """ -from __future__ import division, print_function from copy import copy from math import pi, sqrt diff --git a/periodictable/nsf.py b/periodictable/nsf.py index 84b9e83..f8aeb81 100644 --- a/periodictable/nsf.py +++ b/periodictable/nsf.py @@ -155,7 +155,6 @@ Academic Press. doi:10.1016/B978-0-12-398374-9.09989-7 """ -from __future__ import print_function import numpy as np from numpy import sqrt, pi, asarray, inf diff --git a/periodictable/util.py b/periodictable/util.py index 2f9c25e..af3925d 100644 --- a/periodictable/util.py +++ b/periodictable/util.py @@ -124,11 +124,8 @@ def require_keywords(function): signature element which will force all keywords after '\*' to be named. """ import functools - try: - from inspect import signature - getargspec = _getargspec_from_signature - except ImportError: # CRUFT: py 2.7 support - from inspect import getargspec + from inspect import signature + getargspec = _getargspec_from_signature args, vararg, varkwd, defaults = getargspec(function) if defaults is None: