]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
issue 2549: python3 fix enable-source
authorJason Ish <ish@unx.ca>
Mon, 23 Jul 2018 21:26:56 +0000 (15:26 -0600)
committerJason Ish <ish@unx.ca>
Mon, 23 Jul 2018 21:28:59 +0000 (15:28 -0600)
In Python 3, raw_input was renamed to input. This is now Python 2
and Python 3 compatible.

CHANGELOG.md
suricata/update/commands/enablesource.py

index 217f314fdc3fe137648b1f18fbcc3cdf076262f6..df89831b9ff058c403a1da97c3a2eaa4be6542a7 100644 (file)
@@ -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
index 9600618dabc5ac95b5d3458923d6c3de91ba9e02..8101f89c48a0d927e573c6de95395a7239fd6d36 100644 (file)
@@ -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