Changeset - ea20850dda85
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2020-03-30 16:23:37
mads@kiilerich.com
windows: fix import of posix-only pwd module in d83f41634d06 (Issue #367)
1 file changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/utils2.py
Show inline comments
 
@@ -31,7 +31,6 @@ import binascii
 
import datetime
 
import json
 
import os
 
import pwd
 
import re
 
import time
 
import urllib.parse
 
@@ -45,6 +44,12 @@ from kallithea.lib.vcs.utils import asci
 
from kallithea.lib.vcs.utils.lazy import LazyProperty
 

	
 

	
 
try:
 
    import pwd
 
except ImportError:
 
    pass
 

	
 

	
 
# mute pyflakes "imported but unused"
 
assert ascii_bytes
 
assert ascii_str
 
@@ -331,7 +336,7 @@ def get_clone_url(clone_uri_tmpl, prefix
 
    prefix = urllib.parse.unquote(parsed_url.path.rstrip('/'))
 
    try:
 
        system_user = pwd.getpwuid(os.getuid()).pw_name
 
    except Exception: # TODO: support all systems - especially Windows
 
    except NameError: # TODO: support all systems - especially Windows
 
        system_user = 'kallithea' # hardcoded default value ...
 
    args = {
 
        'scheme': parsed_url.scheme,
0 comments (0 inline, 0 general)