Skip to content

Commit 1cd58e5

Browse files
Refactor code using resource.extracted_from function
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent d7fc4cc commit 1cd58e5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/packagedcode/models.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1200,8 +1200,7 @@ def assign_package_to_resources(cls, package, resource, codebase, package_adder=
12001200
# update `for_packages` of a codebase resource.
12011201
package_uid = package.package_uid
12021202
if resource.path.endswith("-extract"):
1203-
archive_resource_path = resource.path.removesuffix("-extract")
1204-
archive_resource = codebase.get_resource(archive_resource_path)
1203+
archive_resource = resource.extracted_from(codebase)
12051204
if archive_resource:
12061205
package_adder(package_uid, archive_resource, codebase)
12071206

0 commit comments

Comments
 (0)