Commit 3e3af3f4 authored by Daiki Ueno's avatar Daiki Ueno
Browse files

package: do not always assume "pwd" module

It is only available on Unix platforms.
Reported by Gisle Vanem in:
gnutls#1337 (comment 877032569)

Signed-off-by: Daiki Ueno's avatarDaiki Ueno <ueno@gnu.org>
parent 55793d5e
Pipeline #494374264 passed with stage
in 1 minute and 15 seconds
......@@ -6,16 +6,25 @@ from cligen.types import Desc
import datetime
import io
import os
import pwd
import textwrap
try:
import pwd
def get_default_copyright_holder():
return pwd.getpwuid(os.getuid()).pw_gecos
except ImportError:
def get_default_copyright_holder():
return 'COPYRIGHT HOLDER'
class Info(NamedTuple):
name: str
version: str
license: str = 'gpl3+'
copyright_year: str = str(datetime.date.today().year)
copyright_holder: str = pwd.getpwuid(os.getuid()).pw_gecos
copyright_holder: str = get_default_copyright_holder()
bug_email: Optional[str] = None
authors: Sequence[str] = list()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment