Void TSystem::ResetSignal(ESignals /*sig*/, Bool_t /*reset*/)

Hi Professionals,

Could someone help me with this in Python? I need to reset the Signal.
In 5.34, I used to use:
ROOT.gSystem.ResetSignal(ROOT.kSigSegmentationViolation) It worked fine
In 6.08.06, it no longer works.
Instead, I found something in the TSystem,
what I have is
from ROOT import TSystem
TSystem.ResetSignal(ROOT.kSigSegmentationViolation, True)
I got error saying "TypeError: void TSystem::ResetSignal(ESignals sig, bool reset = kTRUE) =>
unbound method TSystem::ResetSignal must be called with a TSystem instance as first argument"
Any suggestions?
Thanks,

try

from ROOT import TSystem
ROOT.gSystem.ResetSignal(ROOT.kSigSegmentationViolation, True)

Thanks a lot for the answer. this one works. But why do I need to import TSystem here?

Also, another question: I have a gROOT.reset() right before this resetSignal(). When I run my program, it always gives me the segmentation violation Break message and terminates my program, while running w/o the gROOT.reset(), it works just fine, and no segmentation violation Break message. Do you know the reason for this?

Again, thanks for your help.

You probably don’t need it. (i.e was a copy/paste oversight).

I have a gROOT.reset() right before this resetSignal()

Do not use gROOT.reset() as it reset the full ROOT environment and indeed should be used very sparingly (i.e. if I recall correctly we have not investigated if gROOT.Reset is safe to use in python/PyROOT but it is unlikely to be … i.e. it is likely to remove things that PyROOT recorded/cached).

Cheers,
Philippe.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.