Skip to content

Commit 4448801

Browse files
committed
Fix invalid py_file in numba cache locator
1 parent 4e4f237 commit 4448801

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pytensor/link/numba/cache.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from collections.abc import Callable
22
from hashlib import sha256
3-
from pathlib import Path
43
from pickle import dump
54
from tempfile import NamedTemporaryFile
65
from typing import Any
@@ -64,8 +63,8 @@ def get_disambiguator(self):
6463
@classmethod
6564
def from_function(cls, py_func, py_file):
6665
"""Create a locator instance for functions stored in CACHED_SRC_FUNCTIONS."""
67-
if config.numba__cache and py_func in CACHED_SRC_FUNCTIONS:
68-
return cls(py_func, Path(py_file).parent, CACHED_SRC_FUNCTIONS[py_func])
66+
if py_func in CACHED_SRC_FUNCTIONS and config.numba__cache:
67+
return cls(py_func, py_file, CACHED_SRC_FUNCTIONS[py_func])
6968

7069

7170
# Register our locator at the front of Numba's locator list

0 commit comments

Comments
 (0)