]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
Fix the broken sys import of distutils
authorShivani Bhardwaj <shivanib134@gmail.com>
Tue, 18 Dec 2018 10:31:40 +0000 (16:01 +0530)
committerJason Ish <ish@unx.ca>
Tue, 18 Dec 2018 22:29:07 +0000 (16:29 -0600)
Newer distutils versions allow to list and work with `sys` as it is
imported in the `__init__.py` however, the older versions of disutils
does not contain anything other than the version and revision strings.
The current installation procedure relied on the former method which is
only adapted in the new versions so make it compatible to the older
versions by importing `sys` from `distutils.core`.

Closes redmine ticket #2747

setup.py

index 14a4b0efda1cb818fddecf0ac1631006f82ab775..3c5c661bcefa8a79a339716a5334194cec53f1aa 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,7 @@ import os.path
 import subprocess
 import distutils
 from distutils.core import setup
+from distutils.core import sys
 
 from suricata.update.version import version
 
@@ -45,7 +46,7 @@ args = {
     ],
 }
 
-if any("pip" in arg for arg in distutils.sys.argv):
+if any("pip" in arg for arg in sys.argv):
     args["install_requires"] = ["pyyaml", ]
 
 setup(**args)