File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 11import os
22import inspect
33import sys
4+ import warnings
5+
46import pytensor
57from pathlib import Path
68
@@ -243,7 +245,7 @@ def find_source():
243245 obj = getattr (obj , part )
244246
245247 fn = Path (inspect .getsourcefile (obj ))
246- fn = fn .relative_to (Path (__file__ ).parent )
248+ fn = fn .relative_to (Path (pytensor . __file__ ).parent )
247249 source , lineno = inspect .getsourcelines (obj )
248250 return fn , lineno , lineno + len (source ) - 1
249251
@@ -252,6 +254,7 @@ def find_source():
252254 try :
253255 filename = "pytensor/%s#L%d-L%d" % find_source ()
254256 except Exception :
257+ warnings .warn (f"Could not find source code for { domain } :{ info } " )
255258 filename = info ["module" ].replace ("." , "/" ) + ".py"
256259 import subprocess
257260
You can’t perform that action at this time.
0 commit comments