Show More
@@ -84,7 +84,10 b' class CannedFunction(CannedObject):' | |||
|
84 | 84 | def __init__(self, f): |
|
85 | 85 | self._check_type(f) |
|
86 | 86 | self.code = f.func_code |
|
87 |
|
|
|
87 | if f.func_defaults: | |
|
88 | self.defaults = [ can(fd) for fd in f.func_defaults ] | |
|
89 | else: | |
|
90 | self.defaults = None | |
|
88 | 91 | self.module = f.__module__ or '__main__' |
|
89 | 92 | self.__name__ = f.__name__ |
|
90 | 93 | self.buffers = [] |
@@ -104,7 +107,11 b' class CannedFunction(CannedObject):' | |||
|
104 | 107 | |
|
105 | 108 | if g is None: |
|
106 | 109 | g = {} |
|
107 | newFunc = FunctionType(self.code, g, self.__name__, self.defaults) | |
|
110 | if self.defaults: | |
|
111 | defaults = tuple(uncan(cfd, g) for cfd in self.defaults) | |
|
112 | else: | |
|
113 | defaults = None | |
|
114 | newFunc = FunctionType(self.code, g, self.__name__, defaults) | |
|
108 | 115 | return newFunc |
|
109 | 116 | |
|
110 | 117 |
General Comments 0
You need to be logged in to leave comments.
Login now