git: 7c8889de076a - main - devel/py-pygpx: Fix build with setuptools 58.0.0+

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Fri, 25 Mar 2022 13:50:09 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7c8889de076a63b6cf76d781d177889b6a7953ef

commit 7c8889de076a63b6cf76d781d177889b6a7953ef
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-03-25 13:32:22 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-03-25 13:38:11 +0000

    devel/py-pygpx: Fix build with setuptools 58.0.0+
    
    With hat:       python
---
 devel/py-pygpx/files/patch-2to3 | 44 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/devel/py-pygpx/files/patch-2to3 b/devel/py-pygpx/files/patch-2to3
new file mode 100644
index 000000000000..a50a30ef4de9
--- /dev/null
+++ b/devel/py-pygpx/files/patch-2to3
@@ -0,0 +1,44 @@
+--- pygpx.py.orig	2006-07-30 12:33:23 UTC
++++ pygpx.py
+@@ -44,7 +44,7 @@ class GPXTrackPt:
+             elif node.nodeName == "ele":
+                 self.elevation = float(node.firstChild.data)
+             else:
+-                raise ValueError, "Can't handle node", node.nodeName
++                raise ValueError("Can't handle node").with_traceback(node.nodeName)
+ 
+     def distance(self, other):
+         """Compute the distance from this point to another."""
+@@ -72,7 +72,7 @@ class GPXTrackSeg:
+             elif node.nodeName == "trkpt":
+                 self.trkpts.append(GPXTrackPt(node, self.version))
+             else:
+-                raise ValueError, "Can't handle node <%s>" % node.nodeName
++                raise ValueError("Can't handle node <%s>" % node.nodeName)
+ 
+     def distance(self):
+         """Return the distance along the track segment."""
+@@ -105,7 +105,7 @@ class GPXTrack:
+             elif node.nodeName == "number":
+                 self.name = node.firstChild.data                
+             else:
+-                raise ValueError, "Can't handle node <%s>" % node.nodeName
++                raise ValueError("Can't handle node <%s>" % node.nodeName)
+ 
+     def distance(self):
+         """Return the distance for this track."""
+@@ -155,7 +155,7 @@ class GPX:
+         if self.version == "1.0":
+             self._init_version_1_0()
+         else:
+-            raise ValueError, "Can't handle version", self.version
++            raise ValueError("Can't handle version").with_traceback(self.version)
+ 
+     def _init_version_1_0(self):
+         """Initialise a version 1.0 GPX instance."""
+@@ -168,4 +168,4 @@ class GPX:
+             elif node.nodeName == "trk":
+                 self.tracks.append(GPXTrack(node, self.version))
+             else:
+-                raise ValueError, "Can't handle node", node.nodeName
++                raise ValueError("Can't handle node").with_traceback(node.nodeName)