From: Lukasz Kosewski Date: Sun, 10 Jan 2010 08:59:20 +0000 (-0500) Subject: helpers.py: Cygwin doesn't support `hostname -f`, use `hostname`. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8498835f8883d4b6581f4bcaf982f5322e9bdbde;p=packages%2Fb%2Fbup.git helpers.py: Cygwin doesn't support `hostname -f`, use `hostname`. --- diff --git a/helpers.py b/helpers.py index b0b054d..344d001 100644 --- a/helpers.py +++ b/helpers.py @@ -51,7 +51,11 @@ def hostname(): global _hostname if not _hostname: try: - _hostname = readpipe(['hostname', '-f']).strip() + if sys.platform == 'cygwin': + hostcmd = ['hostname'] + else: + hostcmd = ['hostname', '-f'] + _hostname = readpipe(hostcmd).strip() except OSError: pass return _hostname or 'localhost'