[checkmk-commits] ast module is now available everywhere

Lars Michelsen lm at mathias-kettner.de
Thu Sep 29 12:12:55 CEST 2016


Module: check_mk
Branch: master
Commit: 3e89f64d71d92fe70f67a93c428c484299796a6c
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e89f64d71d92fe70f67a93c428c484299796a6c

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Wed Sep 28 17:06:54 2016 +0200

ast module is now available everywhere

---

 modules/packaging.py | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/modules/packaging.py b/modules/packaging.py
index 3b53289..3f40c4b 100644
--- a/modules/packaging.py
+++ b/modules/packaging.py
@@ -24,6 +24,7 @@
 # to the Free Software Foundation, Inc., 51 Franklin St,  Fifth Floor,
 # Boston, MA 02110-1301 USA.
 
+import ast
 import pprint, tarfile
 
 import cmk.tty as tty
@@ -640,12 +641,4 @@ def all_package_names():
 
 
 def parse_package_info(python_string):
-    try:
-        # ast.literal_eval does not execute any code, just reads in passive
-        # data structures, so it is safe. But: not available on all supported
-        # Python versions
-        import ast
-    except:
-        return eval(python_string)
-
     return ast.literal_eval(python_string)



More information about the checkmk-commits mailing list