Skip to content

Commit

Permalink
Change type of ImportDefinition.path to pathlib.Path
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Apr 11, 2022
1 parent 7111d87 commit f64ce35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pint/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _iter_definitions(
f"No more files while trying to import {definition.path}."
)

if not pending_files[0].filename.as_posix().endswith(definition.path):
if not str(pending_files[0].filename).endswith(str(definition.path)):
raise ValueError(
"The order of the files do not match. "
f"(expected: {definition.path}, "
Expand Down Expand Up @@ -135,13 +135,13 @@ class PintDiskCache(fc.DiskCache):
class ImportDefinition:
"""Definition for the @import directive"""

path: str
path: pathlib.Path

@classmethod
def from_string(
cls, definition: str, non_int_type: type = float
) -> ImportDefinition:
return ImportDefinition(definition[7:].strip())
return ImportDefinition(pathlib.Path(definition[7:].strip()))


class Parser:
Expand Down

0 comments on commit f64ce35

Please sign in to comment.