This port has no consumers.
ok?
diff -x CVS -Nur py-editdist/Makefile py-editdist.new/Makefile
--- py-editdist/Makefile Tue Feb 23 14:39:18 2021
+++ py-editdist.new/Makefile Wed Mar 10 10:58:05 2021
@@ -4,7 +4,7 @@
MODPY_EGG_VERSION= 0.3
DISTNAME= py-editdist-${MODPY_EGG_VERSION}
-REVISION = 6
+REVISION = 7
CATEGORIES= devel
HOMEPAGE= http://www.mindrot.org/projects/py-editdist/
@@ -18,7 +18,6 @@
MASTER_SITES= http://www.mindrot.org/files/py-editdist/
MODULES= lang/python
-MODPY_VERSION = ${MODPY_DEFAULT_VERSION_2}
MODPY_PYTEST = Yes
MODPY_PYTEST_ARGS = test.py
diff -x CVS -Nur py-editdist/patches/patch-editdist_c
py-editdist.new/patches/patch-editdist_c
--- py-editdist/patches/patch-editdist_c Wed Dec 31 19:00:00 1969
+++ py-editdist.new/patches/patch-editdist_c Wed Mar 10 11:09:28 2021
@@ -0,0 +1,59 @@
+$OpenBSD$
+
+port to python3, from:
+https://github.com/com4/py-editdist/
+
+Index: editdist.c
+--- editdist.c.orig
++++ editdist.c
+@@ -94,7 +94,7 @@ PyDoc_STRVAR(editdist_distance_doc,
+ static PyObject *
+ editdist_distance(PyObject *self, PyObject *args)
+ {
+- char *a, *b;
++ const u_int8_t *a, *b;
+ int alen, blen, r;
+
+ if (!PyArg_ParseTuple(args, "s#s#", &a, &alen, &b, &blen))
+@@ -104,22 +104,36 @@ editdist_distance(PyObject *self, PyObject *args)
+ PyErr_SetString(PyExc_MemoryError, "Out of memory");
+ return NULL;
+ }
+- return PyInt_FromLong(r);
++ return PyLong_FromLong(r);
+ }
+
++//PyDoc_STRVAR(editdist_distance_doc, "Calculate Levenshtein's edit
distance.\n");
++
+ static PyMethodDef editdist_methods[] = {
+ { "distance", (PyCFunction)editdist_distance,
+ METH_VARARGS, editdist_distance_doc },
+ {NULL, NULL, 0, NULL } /* sentinel */
+ };
+
+-PyDoc_STRVAR(module_doc, "Calculate Levenshtein's edit distance.\n");
++static struct PyModuleDef editdist_moduledef = {
++ PyModuleDef_HEAD_INIT,
++ "editdist",
++ NULL,
++ 1000,
++ editdist_methods,
++ NULL,
++ NULL,
++ NULL,
++ NULL
++};
+
+-PyMODINIT_FUNC
+-initeditdist(void)
++PyObject *
++PyInit_editdist(void)
+ {
+ PyObject *m;
+
+- m = Py_InitModule3("editdist", editdist_methods, module_doc);
++ m = PyModule_Create(&editdist_moduledef);
+ PyModule_AddStringConstant(m, "__version__", EDITDIST_VERSION);
++
++ return m;
+ }
diff -x CVS -Nur py-editdist/pkg/PLIST py-editdist.new/pkg/PLIST
--- py-editdist/pkg/PLIST Mon Jan 26 18:43:20 2009
+++ py-editdist.new/pkg/PLIST Wed Mar 10 10:58:15 2021
@@ -1,3 +1,3 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2009/01/26 23:43:20 djm Exp $
lib/python${MODPY_VERSION}/site-packages/editdist-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info
-lib/python${MODPY_VERSION}/site-packages/editdist.so
+@so lib/python${MODPY_VERSION}/site-packages/editdist.${MODPY_PYC_MAGIC_TAG}so