From: Jason Ish Date: Mon, 23 Jul 2018 21:26:56 +0000 (-0600) Subject: issue 2549: python3 fix enable-source X-Git-Tag: 1.0.0rc2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36337ef3d847c2823ac0495735f15aecf1af61d2;p=thirdparty%2Fsuricata-update.git issue 2549: python3 fix enable-source In Python 3, raw_input was renamed to input. This is now Python 2 and Python 3 compatible. --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 217f314..df89831 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ # Change Log -## 1.0.0rc1 - 2018-07-17 +## unreleased +- Python 3 fix for enable-source. + https://redmine.openinfosecfoundation.org/issues/2549 +## 1.0.0rc1 - 2018-07-17 - Python 3 fixes. - Bundle a copy of the index which can be used if download source for the index is not available, and no index was previously diff --git a/suricata/update/commands/enablesource.py b/suricata/update/commands/enablesource.py index 9600618..8101f89 100644 --- a/suricata/update/commands/enablesource.py +++ b/suricata/update/commands/enablesource.py @@ -24,6 +24,11 @@ import yaml from suricata.update import config from suricata.update import sources +try: + input = raw_input +except: + pass + logger = logging.getLogger() default_source = "et/open" @@ -80,7 +85,7 @@ def enable_source(): else: prompt = source["parameters"][param]["prompt"] while True: - r = raw_input("%s (%s): " % (prompt, param)) + r = input("%s (%s): " % (prompt, param)) r = r.strip() if r: break