diff --git a/git_command.py b/git_command.py index 954bebada..7ff1abacc 100644 --- a/git_command.py +++ b/git_command.py @@ -35,8 +35,11 @@ def _ssh_sock(create=True): if _ssh_sock_path is None: if not create: return None + dir = '/tmp' + if not os.path.exists(dir): + dir = tempfile.gettempdir() _ssh_sock_path = os.path.join( - tempfile.mkdtemp('', 'ssh-'), + tempfile.mkdtemp('', 'ssh-', dir), 'master-%r@%h:%p') return _ssh_sock_path