add exception for subprocess git version

fix #35
This commit is contained in:
BennyThink 2022-01-12 20:16:54 +08:00
parent d714252fc5
commit 47c324e905
No known key found for this signature in database
GPG Key ID: 6CD0DBDA5235D481
2 changed files with 6 additions and 4 deletions

1
.gitignore vendored
View File

@ -159,3 +159,4 @@ ytdlbot/ytdl.session
data/*
upgrade_worker.sh
ytdl.session
reinforcement/*

View File

@ -7,10 +7,10 @@
__author__ = "Benny <benny.think@gmail.com>"
import contextlib
import logging
import os
import pathlib
import signal
import subprocess
import time
import uuid
@ -107,8 +107,9 @@ def current_time(ts=None):
def get_revision():
revision = subprocess.check_output("git -C ../ rev-parse --short HEAD".split()).decode("u8").replace("\n", "")
return revision
with contextlib.suppress(subprocess.SubprocessError):
return subprocess.check_output("git -C ../ rev-parse --short HEAD".split()).decode("u8").replace("\n", "")
return "unknown"
def get_func_queue(func) -> int: