From 2324082ad280c9086fd93c4f43c092624fbc3474 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 24 Oct 2019 19:00:42 +0100 Subject: [PATCH] make-secnet-sites: Replace string.atol with int() 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 --- INSTALL | 3 ++- debian/control | 4 ++-- make-secnet-sites | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/INSTALL b/INSTALL index 1616621..020907d 100644 --- 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 diff --git a/debian/control b/debian/control index 6ee3bf1..e0b0f88 100644 --- a/debian/control +++ b/debian/control @@ -5,12 +5,12 @@ Maintainer: Ian Jackson Uploaders: Stephen Early , Richard Kettlewell 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 diff --git a/make-secnet-sites b/make-secnet-sites index 3264adf..f322678 100755 --- a/make-secnet-sites +++ b/make-secnet-sites @@ -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): -- 2.30.2