Explorar el Código

don't import pkg_resources in the top of qubesadmin/utils.py

It's slow to import
qubesuser hace 6 años
padre
commit
d08f1a58b7
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      qubesadmin/utils.py

+ 1 - 2
qubesadmin/utils.py

@@ -25,8 +25,6 @@
 '''Various utility functions.'''
 import os
 
-import pkg_resources
-
 import qubesadmin.exc
 
 
@@ -89,6 +87,7 @@ def get_entry_point_one(group, name):
     '''Get a single entry point of given type,
     raise TypeError when there are multiple.
     '''
+    import pkg_resources
     epoints = tuple(pkg_resources.iter_entry_points(group, name))
     if not epoints:
         raise KeyError(name)