From 426a05a93fbfcc2eb6a5c69e080714483508d6a7 Mon Sep 17 00:00:00 2001 From: Zachary Spar Date: Sun, 28 Jul 2024 14:51:09 -0400 Subject: [PATCH] fix: sanitize summary only if it exists --- py2pack/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py2pack/__init__.py b/py2pack/__init__.py index 5c0dc81..c322e34 100644 --- a/py2pack/__init__.py +++ b/py2pack/__init__.py @@ -350,7 +350,7 @@ def generate(args): source_url = data['source_url'] = (args.source_url or (durl and durl['url'])) data['year'] = datetime.datetime.now().year # set current year data['user_name'] = pwd.getpwuid(os.getuid())[4] # set system user (packager) - data['summary_no_ending_dot'] = re.sub(r'(.*)\.', r'\g<1>', data.get('summary', "")) + data['summary_no_ending_dot'] = re.sub(r'(.*)\.', r'\g<1>', data.get('summary')) if data.get('summary') else "" # If package name supplied on command line differs in case from PyPI's one # then package archive will be fetched but the name will be the one from PyPI.