contrib/generate-asinfo.py: Correcting syntax errors

alarig@jeunet ~ % (echo begin; echo verbose; for i in `seq 1 65535`; do echo "AS$i"; done; echo end) | nc whois.cymru.com 43 | ./generate-asinfo.py > asinfo.txt
  File "./generate-asinfo.py", line 30
    if name.startswith('- '):
                            ^
TabError: inconsistent use of tabs and spaces in indentation
zsh: done       ( echo begin; echo verbose; for i in `seq 1 65535`; do; echo "AS$i"; done;  ;  | nc whois.cymru.com 43 |
zsh: exit 1     ./generate-asinfo.py > asinfo.txt

alarig@jeunet ~ % (echo begin; echo verbose; for i in `seq 1 65535`; do echo "AS$i"; done; echo end) | nc whois.cymru.com 43 | ./generate-asinfo.py > asinfo.txt
  File "./generate-asinfo.py", line 33
    print "%s\t%s\t%s\t%s" % (asn,macro,name,country)
          ^
SyntaxError: invalid syntax
zsh: done       ( echo begin; echo verbose; for i in `seq 1 65535`; do; echo "AS$i"; done;  ;  | nc whois.cymru.com 43 |
zsh: exit 1     ./generate-asinfo.py > asinfo.txt
This commit is contained in:
Alarig Le Lay 2020-08-01 11:22:28 +02:00
parent ab8a48e33e
commit c233dd1ff0
No known key found for this signature in database
GPG Key ID: 7AFE62C6DF8BCDEC

View File

@ -30,4 +30,4 @@ for line in sys.stdin:
if name.startswith('- '):
name = name[2:]
print "%s\t%s\t%s\t%s" % (asn,macro,name,country)
print("%s\t%s\t%s\t%s" % (asn,macro,name,country))