File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,9 @@ def transform(dist):
119119 licenses = get_licenses_from_classifiers (dist ) or get_license (dist ) or []
120120 # Strip the useless "License" suffix and uniquify
121121 licenses = list (set ([strip_license (l ) for l in licenses ]))
122+ # Removing Trailing windows generated \r
123+ licenses = list (set ([strip_license_for_windows (l ) for l in licenses ]))
124+
122125 return {
123126 'name' : dist .project_name ,
124127 'version' : dist .version ,
@@ -147,7 +150,12 @@ def get_licenses_from_classifiers(dist):
147150 return [m for m in regex_classifier .findall (metadata ) if m ]
148151
149152 return []
150-
153+
154+ def strip_license_for_windows (license ):
155+ if license .endswith ("\r " ):
156+ return license [:- 1 ]
157+ return license
158+
151159 def strip_license (license ):
152160 if license .lower ().endswith (" license" ):
153161 return license [:- len (" license" )]
You can’t perform that action at this time.
0 commit comments