Ver código fonte

Cope with missing getpwnam on windows.

Jelmer Vernooij 3 anos atrás
pai
commit
346fa892a6
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      dulwich/repo.py

+ 2 - 2
dulwich/repo.py

@@ -147,8 +147,8 @@ def _get_default_identity() -> Tuple[str, str]:
         fullname = None
     else:
         try:
-            gecos = pwd.getpwnam(username).pw_gecos
-        except KeyError:
+            gecos = pwd.getpwnam(username).pw_gecos  # type: ignore
+        except (KeyError, AttributeError):
             fullname = None
         else:
             if gecos: