[Git][NTPsec/ntpsec][master] Force input() to be an alias for raw_input() on Python2

Matt Selsky gitlab at mg.gitlab.com
Fri Dec 30 16:50:30 UTC 2016


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
b4d05e71 by Matt Selsky at 2016-12-30T11:39:16-05:00
Force input() to be an alias for raw_input() on Python2

Python3 input() and Python2's raw_input() are equivalent. Python2's input() is
equivalent to eval(raw_input()) and therefore it can throw NameError exceptions
if you pass it invalid python code.

Fixes GitLab issue #221

- - - - -


1 changed file:

- pylib/packet.py


Changes:

=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -219,6 +219,7 @@ if str is bytes:  # Python 2
     polybytes = bytes
     polyord = ord
     polychr = str
+    input = raw_input
 
     def string_escape(s):
         return s.decode('string_escape')



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/b4d05e711a64b9ae3884ce71eaed56c5353e69b0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20161230/f97c953b/attachment.html>


More information about the vc mailing list