Skip to content

Commit

Permalink
Fix path confusion on Windows (#1065)
Browse files Browse the repository at this point in the history
This fixes an issue when running Slither on Windows. Some paths were
being stringified as Windows-style (backslash) while the rest of the
paths use POSIX-style (forward slash). This caused an issue when
trying to match paths, and Slither would complain the dependency
was not present.

After this change, the paths for import directives are always expressed
as POSIX-style paths when stringified.

See the following issue for a complete error message:

    crytic/crytic-compile#241
  • Loading branch information
elopez authored Mar 18, 2022
1 parent d41861e commit c079206
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion slither/core/declarations/import_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def filename(self) -> str:
:return:
:rtype:
"""
return str(self._filename)
return self._filename.as_posix()

@property
def filename_path(self) -> Path:
Expand Down

0 comments on commit c079206

Please sign in to comment.