mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-09 22:36:14 +01:00
commit
abfc30e59d
22
osc/cmdln.py
22
osc/cmdln.py
@ -48,22 +48,8 @@ import time
|
||||
from pprint import pprint
|
||||
from datetime import datetime
|
||||
|
||||
# this is python 2.x style
|
||||
def introspect_handler_2(handler):
|
||||
# Extract the introspection bits we need.
|
||||
func = handler.im_func
|
||||
if func.func_defaults:
|
||||
func_defaults = func.func_defaults
|
||||
else:
|
||||
func_defaults = []
|
||||
return \
|
||||
func_defaults, \
|
||||
func.func_code.co_argcount, \
|
||||
func.func_code.co_varnames, \
|
||||
func.func_code.co_flags, \
|
||||
func
|
||||
|
||||
def introspect_handler_3(handler):
|
||||
def introspect_handler(handler):
|
||||
defaults = handler.__defaults__
|
||||
if not defaults:
|
||||
defaults = []
|
||||
@ -76,12 +62,6 @@ def introspect_handler_3(handler):
|
||||
handler.__code__.co_flags, \
|
||||
handler.__func__
|
||||
|
||||
if sys.version_info[0] == 2:
|
||||
introspect_handler = introspect_handler_2
|
||||
bytes = lambda x, *args: x
|
||||
else:
|
||||
introspect_handler = introspect_handler_3
|
||||
|
||||
|
||||
#---- globals
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user