Skip to content

Commit

Permalink
Fix checking git URLs for Python 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Nov 17, 2023
1 parent 3a87557 commit 63e6cf1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drp.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,16 @@ def get_git_url(entity):
folder = os.path.dirname(entity)
url = None
try:
url = subprocess.check_output(["git", "-C", folder, "remote", "get-url", "origin"], universal_newlines=True, creationflags=subprocess.CREATE_NO_WINDOW)
si = None
if os.name == 'nt':
si = subprocess.STARTUPINFO()
si.dwFlags = subprocess.SW_HIDE | subprocess.STARTF_USESHOWWINDOW
url = subprocess.check_output(["git", "-C", folder, "remote", "get-url", "origin"], universal_newlines=True, startupinfo=si)
except:
url = get_git_url_from_config(folder)

if url is not None:
url = parse_git_url(url)
url = parse_git_url(url).strip()
return url

return None
Expand Down

0 comments on commit 63e6cf1

Please sign in to comment.