Use getpass instead of pwd to fetch username

getpass is available onn windows as well as unix, whereas pwd is not
available on windows.
pull/683/head
Tim Head 2019-05-21 08:32:53 +02:00
rodzic 368a64018d
commit 02ec2255d6
1 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -7,13 +7,12 @@ Usage:
python -m repo2docker https://github.com/you/your-repo
"""
import argparse
import errno
import json
import sys
import logging
import os
import pwd
import getpass
import shutil
import tempfile
import time
@ -213,7 +212,7 @@ class Repo2Docker(Application):
"""
Default user_name to current running user.
"""
return pwd.getpwuid(os.getuid()).pw_name
return getpass.getuser()
appendix = Unicode(
config=True,