From 9ad85a3dffcc94a4e3368e5ee4a247d857689954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 12 Aug 2017 22:42:30 +0200 Subject: [PATCH] storage: fix getting list of pool driver parameters function.func_code existed in python2. Use inspect module (instead of __code__ attribute). --- qubes/storage/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qubes/storage/__init__.py b/qubes/storage/__init__.py index b2850892..5bc5f1a9 100644 --- a/qubes/storage/__init__.py +++ b/qubes/storage/__init__.py @@ -822,8 +822,9 @@ def driver_parameters(name): ''' Get __init__ parameters from a driver with out `self` & `name`. ''' init_function = qubes.utils.get_entry_point_one( qubes.storage.STORAGE_ENTRY_POINT, name).__init__ - params = init_function.func_code.co_varnames - ignored_params = ['self', 'name'] + signature = inspect.signature(init_function) + params = signature.parameters.keys() + ignored_params = ['self', 'name', 'kwargs'] return [p for p in params if p not in ignored_params]