diff options
author | teor <teor@torproject.org> | 2019-12-12 15:58:51 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-12-12 15:58:51 +1000 |
commit | 1619f14a0420b0a57d65b9adeab8e8a4ef222b3a (patch) | |
tree | e58abb1dd7d9bae4d48ca00fb7b10b837d952a67 /scripts/codegen | |
parent | a38014e5c6fa7955e9af61b42eddb2bc9edc29a9 (diff) | |
download | tor-1619f14a0420b0a57d65b9adeab8e8a4ef222b3a.tar.gz tor-1619f14a0420b0a57d65b9adeab8e8a4ef222b3a.zip |
python: Add __future__ imports for python 3 compatibility
Except for src/ext, which we may not want to modify.
Closes ticket 32732.
Diffstat (limited to 'scripts/codegen')
-rwxr-xr-x | scripts/codegen/fuzzing_include_am.py | 5 | ||||
-rwxr-xr-x | scripts/codegen/gen_server_ciphers.py | 5 | ||||
-rwxr-xr-x | scripts/codegen/get_mozilla_ciphers.py | 5 | ||||
-rw-r--r-- | scripts/codegen/makedesc.py | 5 |
4 files changed, 20 insertions, 0 deletions
diff --git a/scripts/codegen/fuzzing_include_am.py b/scripts/codegen/fuzzing_include_am.py index a944584453..aa3ba49a73 100755 --- a/scripts/codegen/fuzzing_include_am.py +++ b/scripts/codegen/fuzzing_include_am.py @@ -1,5 +1,10 @@ #!/usr/bin/python +# Future imports for Python 2.7, mandatory in 3.0 +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + FUZZERS = """ consensus descriptor diff --git a/scripts/codegen/gen_server_ciphers.py b/scripts/codegen/gen_server_ciphers.py index 5d326f8b9e..dd295b7f7d 100755 --- a/scripts/codegen/gen_server_ciphers.py +++ b/scripts/codegen/gen_server_ciphers.py @@ -8,6 +8,11 @@ # # Run it on all the files in your openssl include directory. +# Future imports for Python 2.7, mandatory in 3.0 +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + import re import sys diff --git a/scripts/codegen/get_mozilla_ciphers.py b/scripts/codegen/get_mozilla_ciphers.py index f23f2f1e6f..d149c71c27 100755 --- a/scripts/codegen/get_mozilla_ciphers.py +++ b/scripts/codegen/get_mozilla_ciphers.py @@ -10,6 +10,11 @@ # It takes two arguments: the location of a firefox source directory, and the # location of an openssl source directory. +# Future imports for Python 2.7, mandatory in 3.0 +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + import os import re import sys diff --git a/scripts/codegen/makedesc.py b/scripts/codegen/makedesc.py index efca4dda9a..7d8177f469 100644 --- a/scripts/codegen/makedesc.py +++ b/scripts/codegen/makedesc.py @@ -9,6 +9,11 @@ # I've used this to make inputs for unit tests. I wouldn't suggest # using it for anything else. +# Future imports for Python 2.7, mandatory in 3.0 +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + import base64 import binascii import ctypes |