summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/maketype.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-09 16:31:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-16 23:32:39 +0100
commit1fc840ffc0267ecf3a15c4a59ab44869ef1d6339 (patch)
treeb2932a0d0d7146bde799db47497236063050fc84 /meta/lib/oe/maketype.py
parent22c8ed6484e0ee9328e3844c9e794f3d89ebb9f7 (diff)
downloadpoky-1fc840ffc0267ecf3a15c4a59ab44869ef1d6339.tar.gz
meta: python3 megapatch
This needs splutting into smaller units, WIP atm. (From OE-Core rev: 21529228a7dca96a6a1b44ed9380c523efdeeb3e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/maketype.py')
-rw-r--r--meta/lib/oe/maketype.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/meta/lib/oe/maketype.py b/meta/lib/oe/maketype.py
index 139f333691..de344a802c 100644
--- a/meta/lib/oe/maketype.py
+++ b/meta/lib/oe/maketype.py
@@ -6,7 +6,8 @@ the arguments of the type's factory for details.
6""" 6"""
7 7
8import inspect 8import inspect
9import types 9import oe.types as types
10import collections
10 11
11available_types = {} 12available_types = {}
12 13
@@ -53,7 +54,9 @@ def get_callable_args(obj):
53 if type(obj) is type: 54 if type(obj) is type:
54 obj = obj.__init__ 55 obj = obj.__init__
55 56
56 args, varargs, keywords, defaults = inspect.getargspec(obj) 57 sig = inspect.signature(obj)
58 args = list(sig.parameters.keys())
59 defaults = list(s for s in sig.parameters.keys() if sig.parameters[s].default != inspect.Parameter.empty)
57 flaglist = [] 60 flaglist = []
58 if args: 61 if args:
59 if len(args) > 1 and args[0] == 'self': 62 if len(args) > 1 and args[0] == 'self':
@@ -93,7 +96,8 @@ for name in dir(types):
93 continue 96 continue
94 97
95 obj = getattr(types, name) 98 obj = getattr(types, name)
96 if not callable(obj): 99 if not isinstance(obj, collections.Callable):
97 continue 100 continue
98 101
99 register(name, obj) 102 register(name, obj)
103