Skip to content

Commit

Permalink
except BrokenPipeError on github (#2535)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReimarBauer authored Sep 19, 2024
1 parent 2a68b25 commit e7ff048
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,22 @@
import os
import fs
import tempfile
import logging
from fs.tempfs import TempFS

try:
import git
except ImportError:
SHA = ""
else:
repo = git.Repo(os.path.dirname(os.path.realpath(__file__)), search_parent_directories=True)
path = os.path.dirname(os.path.realpath(__file__))
repo = git.Repo(path, search_parent_directories=True)
logging.debug(path)
try:
# this is for local development important to get a fresh named tmpdir
SHA = repo.head.object.hexsha[0:10]
except ValueError:
except (ValueError, BrokenPipeError) as ex:
logging.debug("Unknown Problem: %s", ex)
# mounted dir in docker container and owner is not root
SHA = ""

Expand Down

0 comments on commit e7ff048

Please sign in to comment.