diff options
author | Gerald Combs <gerald@wireshark.org> | 2019-04-22 10:10:02 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2019-04-22 18:41:35 +0000 |
commit | 83b2f1bca578360712005ec22bf020ba523fd3b0 (patch) | |
tree | 045dcc8737b239da39e9336554c71d2570d37b86 /tools/update-tools-help.py | |
parent | 6f31151f07e691553e93266af8d0f8c0a4c0c668 (diff) |
Tools: Make a couple of scripts Python 3-only.
Remove Python 2 support from make-services.py and update-tools-help.py.
Change-Id: I1304038ca07d1d7354795f7b7faacd3747313653
Reviewed-on: https://code.wireshark.org/review/32943
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'tools/update-tools-help.py')
-rwxr-xr-x | tools/update-tools-help.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/update-tools-help.py b/tools/update-tools-help.py index 0d0145ca57..625afacba8 100755 --- a/tools/update-tools-help.py +++ b/tools/update-tools-help.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # update-tools-help.py - Update the command line help output in docbook/wsug_src. @@ -24,6 +24,10 @@ import subprocess import sys def main(): + if sys.version_info[0] < 3: + print("This requires Python 3") + sys.exit(2) + parser = argparse.ArgumentParser(description='Update Wireshark tools help') parser.add_argument('-p', '--program-path', nargs=1, default=os.path.curdir, help='Path to Wireshark executables.') args = parser.parse_args() @@ -63,10 +67,7 @@ def main(): if thf_flag == '-h': raise e - if sys.version_info[0] >= 3: - new_help = new_help_data.decode('UTF-8', 'replace') - else: - new_help = unicode(new_help_data, 'UTF-8', 'replace') + new_help = new_help_data.decode('UTF-8', 'replace') cur_lines = cur_help.splitlines() new_lines = new_help.splitlines() |