Skip to content

Commit

Permalink
Small fix for debuginfo that can be None (#1469)
Browse files Browse the repository at this point in the history
  • Loading branch information
kotsaloscv authored Dec 11, 2023
1 parent 38c8f07 commit cfafe0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dace/sourcemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import os
import socket
from typing import Optional
from dace import Config, dtypes
from dace.sdfg import state
from dace.sdfg import nodes
Expand Down Expand Up @@ -293,8 +294,8 @@ def mapper(self, sdfg) -> bool:

for nested_sdfg in sdfg.all_sdfgs_recursive():
# NOTE: SDFGs created with the API may not have debuginfo
debuginfo: dtypes.DebugInfo = nested_sdfg.debuginfo
if debuginfo.filename:
debuginfo: Optional[dtypes.DebugInfo] = nested_sdfg.debuginfo
if debuginfo and debuginfo.filename:
range_dict[debuginfo.filename].append((debuginfo.start_line, debuginfo.end_line))

self.create_mapping(range_dict)
Expand Down

0 comments on commit cfafe0f

Please sign in to comment.