File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
cyclonedx_py/_internal/utils Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -91,25 +91,18 @@ def gather_license_texts(
9191 # per spec > license files are stored in the `.dist-info/licenses/` subdirectory of the produced wheel.
9292 # but in practice, other locations are used, too.
9393 # loop over the candidate location and pick the first one found.
94- malformed = None
9594 content = None
9695 for loc in ('licenses' , 'license_files' , '.' ):
9796 path = join (loc , mlfile )
9897 try :
9998 content = dist .read_text (path )
10099 except UnicodeDecodeError :
101- # Malformed, stop looking
102- malformed = path
103- break
100+ # Malformed, try harder
101+ content = handle_bad_license_file_encoding (dist , mlfile , logger )
104102
105103 if content is not None :
106104 break
107-
108- if content is None and malformed :
109- # Try a little harder
110- content = handle_bad_license_file_encoding (dist , malformed , logger )
111-
112- if content is None :
105+ else :
113106 logger .debug ('Error: failed to read license file %r for dist %r' ,
114107 mlfile , dist .metadata ['Name' ])
115108 continue
You can’t perform that action at this time.
0 commit comments