Skip to content

Fixes #1688 single.py ResourceWarning #1689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions single/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,13 @@ def is_include_guard(line):


def get_revision():
return os.popen('git rev-parse --short HEAD').read().strip()
with os.popen('git rev-parse --short HEAD') as f:
return f.read().strip()


def get_version():
return os.popen('git describe --tags --abbrev=0').read().strip()
with os.popen('git describe --tags --abbrev=0') as f:
return f.read().strip()


def process_file(filename, out):
Expand Down