chiark / gitweb /
make-secnet-sites: Replace string.atol with int()
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 24 Oct 2019 18:00:42 +0000 (19:00 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 24 Oct 2019 18:16:16 +0000 (19:16 +0100)
string.atol retured a long, I assume.  In python2, longs and ints are
distinct.  We could use long() here.  But that is not available in
python3.  Instead, write the python3 version already: just int.  We
can get an `int' that always produces longs from the python-future
module.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
INSTALL
debian/control
make-secnet-sites

diff --git a/INSTALL b/INSTALL
index 1616621f6f943d81cc6612640641164cc737e999..020907d884838a1a37a482a3a3d141851d71b21d 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -30,7 +30,8 @@ http://vtun.sourceforge.net/tun/
 You will probably be using the supplied `make-secnet-sites' program to
 generate your VPN's list of sites as a secnet configuration from a
 more-human-writeable form.  If so you need to install the standard
-`ipaddr' Python module (python-ipaddr on Debian-derived systems).
+`future' and `ipaddr' Python modules (python-future and python-ipaddr
+on Debian-derived systems).
 
 ** System and network configuration
 
index 6ee3bf1d36978fae7471901ddbd7a5f4d4888a4f..e0b0f8831c339056e720b823f70ef5440c324fcb 100644 (file)
@@ -5,12 +5,12 @@ Maintainer: Ian Jackson <ijackson@chiark.greenend.org.uk>
 Uploaders: Stephen Early <steve@greenend.org.uk>,
            Richard Kettlewell <rjk@terraraq.org.uk>
 Build-Depends: debhelper (>= 5), libgmp3-dev, libadns1-dev, bison, flex,
-               libbsd-dev, python-ipaddr, tclx, tcl, libtcl-chiark-1
+               libbsd-dev, python-ipaddr, python-future, tclx, tcl, libtcl-chiark-1
 Standards-Version: 3.0.1
 
 Package: secnet
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, python-ipaddr
+Depends: ${shlibs:Depends}, ${misc:Depends}, python-future, python-ipaddr
 Recommends: python
 Description: VPN software for distributed networks
  secnet allows multiple private networks, each 'hidden' behind a single
index 3264adfb8b864a3c23935965c1ef2a82856ce43a..f32267824cbd954177416cb9bcfac3c9582e73f6 100755 (executable)
@@ -52,6 +52,7 @@ Cendio Systems AB.
 """
 
 from __future__ import print_function
+from builtins import int
 
 import string
 import time
@@ -191,7 +192,7 @@ class boolean (basetype):
 class num (basetype):
        "A decimal number"
        def __init__(self,w):
-               self.n=string.atol(w[1])
+               self.n=int(w[1])
        def __str__(self):
                return '%d'%(self.n)
 
@@ -199,7 +200,7 @@ class address (basetype):
        "A DNS name and UDP port number"
        def __init__(self,w):
                self.adr=w[1]
-               self.port=string.atoi(w[2])
+               self.port=int(w[2])
                if (self.port<1 or self.port>65535):
                        complain("invalid port number")
        def __str__(self):
@@ -208,7 +209,7 @@ class address (basetype):
 class rsakey (basetype):
        "An RSA public key"
        def __init__(self,w):
-               self.l=string.atoi(w[1])
+               self.l=int(w[1])
                self.e=w[2]
                self.n=w[3]
        def __str__(self):