Skip to content

Commit d772c57

Browse files
committed
fix: removed unused isPy3VersionNumber function
1 parent 5b351c4 commit d772c57

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

src/DIRAC/FrameworkSystem/scripts/dirac_admin_update_instance.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,6 @@ def updateHost(hostName, version):
116116
gLogger.error("Cannot connect to %s" % host)
117117
return result
118118

119-
# If the server is already running python 3,
120-
# convert the version to be installed to python3
121-
existingVersion = result["Value"]["version"]
122-
if DIRAC.isPy3VersionNumber(existingVersion):
123-
version = DIRAC.convertToPy3VersionNumber(version)
124-
125119
gLogger.notice(
126120
"Initiating software update of %s to %s, this can take a while, please be patient ..." % (host, version)
127121
)

src/DIRAC/__init__.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,6 @@
8989
alarmMail = "[email protected]"
9090

9191

92-
def isPy3VersionNumber(releaseVersion):
93-
"""Returns True if the releaseVersion is a PEP-440 style string.
94-
This is the `is_canonical` function defined in PEP-440 Appendix B
95-
96-
:param str releaseVersion: The software version to use
97-
"""
98-
return (
99-
re.match(
100-
r"^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$",
101-
releaseVersion,
102-
)
103-
is not None
104-
)
105-
106-
10792
def convertToPy3VersionNumber(releaseVersion):
10893
"""Convert the releaseVersion into a PEP-440 style string
10994

0 commit comments

Comments
 (0)