install: show a message to the user if the distutile package cannot be imported.

Thu, 24 May 2018 19:16:36 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 24 May 2018 19:16:36 +0200
changeset 6304
68f9aa03bf75
parent 6303
ec9ebaf206fb
child 6305
7652b925c25e

install: show a message to the user if the distutile package cannot be imported.

install-debugclients.py file | annotate | diff | comparison | revisions
install.py file | annotate | diff | comparison | revisions
--- a/install-debugclients.py	Wed May 23 19:36:11 2018 +0200
+++ b/install-debugclients.py	Thu May 24 19:16:36 2018 +0200
@@ -27,7 +27,6 @@
 import compileall
 import shutil
 import fnmatch
-import distutils.sysconfig
 
 # Define the globals.
 progName = None
@@ -96,6 +95,12 @@
     simple assignment.
     """
     global modDir, pyModDir
+    
+    try:
+        import distutils.sysconfig
+    except ImportError:
+        print("Please install the 'distutils' package first.")
+        exit(5)
 
     modDir = distutils.sysconfig.get_python_lib(True)
     pyModDir = modDir
--- a/install.py	Wed May 23 19:36:11 2018 +0200
+++ b/install.py	Thu May 24 19:16:36 2018 +0200
@@ -29,7 +29,6 @@
 import glob
 import shutil
 import fnmatch
-import distutils.sysconfig
 import codecs
 import subprocess
 import time
@@ -233,7 +232,13 @@
     simple assignment.
     """
     global platBinDir, modDir, pyModDir, apisDir, pyqtVariant, platBinDirOld
-
+    
+    try:
+        import distutils.sysconfig
+    except ImportError:
+        print("Please install the 'distutils' package first.")
+        exit(5)
+    
     if sys.platform.startswith("win"):
         platBinDir = sys.exec_prefix
         if platBinDir.endswith("\\"):

eric ide

mercurial