diff --git a/numba_cuda/numba/cuda/cudadrv/driver.py b/numba_cuda/numba/cuda/cudadrv/driver.py index 108b92b..225e0df 100644 --- a/numba_cuda/numba/cuda/cudadrv/driver.py +++ b/numba_cuda/numba/cuda/cudadrv/driver.py @@ -2691,7 +2691,7 @@ def add_file_guess_ext(self, path_or_code): object represents a file already in memory. """ if isinstance(path_or_code, str): - ext = pathlib.Path(path_or_code).suffix.lstrip('.') + ext = pathlib.Path(path_or_code).suffix if ext == '': raise RuntimeError( "Don't know how to link file with no extension" @@ -2699,11 +2699,11 @@ def add_file_guess_ext(self, path_or_code): elif ext == '.cu': self.add_cu_file(path_or_code) else: - kind = FILE_EXTENSION_MAP.get(ext, None) + kind = FILE_EXTENSION_MAP.get(ext.lstrip('.'), None) if kind is None: raise RuntimeError( "Don't know how to link file with extension " - f".{ext}" + f"{ext}" ) self.add_file(path_or_code, kind) return