import migen
d = os.getcwd()
os.chdir(os.path.dirname(migen.__file__))
- r = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])[:-1].decode("utf-8")
+ try:
+ r = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])[:-1].decode("utf-8")
+ except:
+ r = "--------"
os.chdir(d)
return r
import litex
d = os.getcwd()
os.chdir(os.path.dirname(litex.__file__))
- r = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])[:-1].decode("utf-8")
+ try:
+ r = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])[:-1].decode("utf-8")
+ except:
+ r = "--------"
os.chdir(d)
return r
get_litex_git_revision())
r += "{}\n".format(datetime.datetime.fromtimestamp(time.time()).strftime("%Y-%m-%d %H:%M:%S"))
r += line_comment + "-"*80 + "\n"
- return r
\ No newline at end of file
+ return r