mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
bpdb - handle exception caused when placing bp in a __init__ function
This commit is contained in:
parent
045f7acb41
commit
64083938fa
@ -4409,7 +4409,7 @@ class BpDb:
|
|||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def bpGroup(*args, **kArgs):
|
def bpGroup(*args, **kArgs): #rename bpGroup -> bpPreset
|
||||||
def functor(*cArgs, **ckArgs):
|
def functor(*cArgs, **ckArgs):
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -4485,9 +4485,13 @@ class bp:
|
|||||||
#look for self
|
#look for self
|
||||||
if grp is None:
|
if grp is None:
|
||||||
slf = inspect.stack()[frameCount][0].f_locals.get('self')
|
slf = inspect.stack()[frameCount][0].f_locals.get('self')
|
||||||
if slf:
|
try:
|
||||||
className = slf.__class__.__name__
|
if slf:
|
||||||
grp = className
|
className = slf.__class__.__name__
|
||||||
|
grp = className
|
||||||
|
except:
|
||||||
|
#in __init__ 'self' exists but 'if slf' will crash
|
||||||
|
pass
|
||||||
#default to module
|
#default to module
|
||||||
if grp is None:
|
if grp is None:
|
||||||
grp = moduleName
|
grp = moduleName
|
||||||
|
Loading…
x
Reference in New Issue
Block a user