Skip to content

Commit

Permalink
Fix faulty file-path in warning (#144)
Browse files Browse the repository at this point in the history
Signed-off-by: Ziv Nevo <[email protected]>
  • Loading branch information
zivnevo authored Dec 11, 2024
1 parent 9275230 commit e63f376
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nca/Parsers/GenericYamlParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from nca.CoreDS.DimensionsManager import DimensionsManager
from nca.CoreDS.Peer import IpBlock
from nca.Utils.NcaLogger import NcaLogger
from nca.FileScanners.GenericTreeScanner import ObjectWithLocation
from nca.FileScanners.GenericTreeScanner import ObjectWithLocation, YamlFile


class GenericYamlParser:
Expand Down Expand Up @@ -61,7 +61,8 @@ def warning(self, msg, obj=None):
"""
print_msg = 'Warning: ' + msg
if isinstance(obj, ObjectWithLocation):
print_msg = f'{self.yaml_file_name}:{obj.line_number}:{obj.column_number}: {print_msg}'
file_path = self.yaml_file_name.path if isinstance(self.yaml_file_name, YamlFile) else self.yaml_file_name
print_msg = f'{file_path}:{obj.line_number}:{obj.column_number}: {print_msg}'

NcaLogger().log_message(print_msg, file=stderr)
self.warning_msgs.append(msg)
Expand Down

0 comments on commit e63f376

Please sign in to comment.