Skip to content

Commit

Permalink
Address ValueError on unrelative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
atugushev committed Jun 29, 2023
1 parent 549e74d commit 4008509
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion piptools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,14 @@ def select_config_file(src_files: tuple[str, ...]) -> Path | None:
),
None,
)
return config_file_path.relative_to(working_directory) if config_file_path else None
if config_file_path is None:
return None

return (
config_file_path.relative_to(working_directory)
if config_file_path.is_relative_to(working_directory)
else config_file_path
)


# Some of the defined click options have different `dest` values than the defaults
Expand Down

0 comments on commit 4008509

Please sign in to comment.