Small fix of codestyle violations
Change-Id: Ib6046c83a1261421b930cd25e29e88f5169fbb61 Related-Bug: #1482643
This commit is contained in:
parent
2b7ce18e79
commit
d89cb76503
@ -17,7 +17,6 @@ import json
|
||||
import time
|
||||
import traceback
|
||||
import yaml
|
||||
import os.path
|
||||
import os
|
||||
import posixpath
|
||||
import re
|
||||
|
@ -13,15 +13,18 @@
|
||||
# under the License.
|
||||
|
||||
import yaml
|
||||
import os.path
|
||||
import os
|
||||
import types
|
||||
|
||||
|
||||
def copy_func(f, name=None):
|
||||
'''return a function with same code, globals, defaults, closure, and
|
||||
"""
|
||||
:param f:
|
||||
:param name:
|
||||
:return: a function with same code, globals, defaults, closure, and
|
||||
name (or provide a new name)
|
||||
'''
|
||||
"""
|
||||
|
||||
fn = types.FunctionType(f.__code__, f.__globals__, name or f.__name__,
|
||||
f.__defaults__, f.__closure__)
|
||||
# in case f was given attrs (note this dict is a shallow copy):
|
||||
|
Loading…
Reference in New Issue
Block a user