diff --git a/debian/changelog b/debian/changelog
index 443c39b60fdc410552ec8ebc3cdebe93002cc32d..fc70eb60e382675ff8683906c637b0ea3159d166 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+python-ecdsa (0.19.0-2) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Fix NameError in ecdsa.numbertheory caused by remove-six.patch.
+
+ -- Colin Watson <cjwatson@debian.org>  Tue, 30 Apr 2024 11:20:31 +0100
+
 python-ecdsa (0.19.0-1) unstable; urgency=medium
 
   * Team Upload.
diff --git a/debian/patches/remove-six.patch b/debian/patches/remove-six.patch
index b788e52c95f6d9ad46598214c452e6f2d4bfb30f..3ea924ebf8972dac57bf0012495f871a17309440 100644
--- a/debian/patches/remove-six.patch
+++ b/debian/patches/remove-six.patch
@@ -180,13 +180,15 @@ Forwarded: https://github.com/tlsfuzzer/python-ecdsa/pull/294
          # The privkey pem may have multiple sections, commonly it also has
 --- a/src/ecdsa/numbertheory.py
 +++ b/src/ecdsa/numbertheory.py
-@@ -12,8 +12,7 @@
+@@ -12,8 +12,9 @@
  from __future__ import division
  
  import sys
 -from six import integer_types, PY2
 -from six.moves import reduce
 +from functools import reduce
++
++integer_types = int,
  
  try:
      xrange
@@ -203,24 +205,6 @@ Forwarded: https://github.com/tlsfuzzer/python-ecdsa/pull/294
      for b in xrange(2, range_top):  # pragma: no branch
          if jacobi(b * b - 4 * a, p) == -1:
              f = (a, -b, 1)
-@@ -339,7 +334,7 @@
- def factorization(n):
-     """Decompose n into a list of (prime,exponent) pairs."""
- 
--    assert isinstance(n, integer_types)
-+    assert isinstance(n, int)
- 
-     if n < 2:
-         return []
-@@ -402,7 +397,7 @@
-         DeprecationWarning,
-     )
- 
--    assert isinstance(n, integer_types)
-+    assert isinstance(n, int)
- 
-     if n < 3:
-         return 1
 --- a/src/ecdsa/test_pyecdsa.py
 +++ b/src/ecdsa/test_pyecdsa.py
 @@ -16,7 +16,6 @@