build/generic_programmer: move requests import to do it only when needed.

This commit is contained in:
Florent Kermarrec 2020-04-16 08:44:36 +02:00
parent c9ab593989
commit c0c5ae558a
1 changed files with 2 additions and 1 deletions

View 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))