build/generic_programmer: move requests import to do it only when needed.
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 16 Apr 2020 06:44:36 +0000 (08:44 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 16 Apr 2020 06:44:36 +0000 (08:44 +0200)
litex/build/generic_programmer.py

index 2fb344443f0e5e18adb8e9e3e6d3a9fb29292cc3..3944403007c939c1866f1d72e52875d8ca58d775 100644 (file)
@@ -5,7 +5,7 @@
 
 import os
 import sys
-import requests
+
 from litex.build import tools
 
 
@@ -38,6 +38,7 @@ class GenericProgrammer:
         if os.path.exists(fullname):
             return fullname
         # Search in repositories and download it
+        import requests
         os.makedirs(self.flash_proxy_local, exist_ok=True)
         for d in self.flash_proxy_repos:
             fullname = tools.cygpath(os.path.join(self.flash_proxy_local, self.flash_proxy_basename))