syscalls: fix default table path
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 22 Sep 2023 18:08:57 +0000 (21:08 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 26 Sep 2023 21:08:32 +0000 (22:08 +0100)
src/openpower/syscalls/__init__.py

index c59b47a8b7c9dcda3e96890c0670f84257765ae7..68bef552b7e3eb1163cbf2f50469b993160bd6f6 100644 (file)
@@ -1,5 +1,4 @@
 import ctypes
-import functools
 import inspect
 import json
 import pathlib
@@ -73,8 +72,7 @@ class UnknownSyscall(Syscall):
 class Dispatcher:
     def __init__(self, guest, host, logger=None, table=None):
         if table is None:
-            path = pathlib.Path(inspect.getfile(self.__class__))
-            path = (path.parent / "syscalls.json")
+            path = (pathlib.Path(__file__).parent / "syscalls.json")
             with open(path, "r", encoding="UTF-8") as stream:
                 table = json.load(stream)
         if not isinstance(table, dict):