File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -101,15 +101,17 @@ def __init__ ( self , batch = True ) :
101
101
## context manager: ENTER
102
102
def __enter__ ( self ) :
103
103
groot = ROOT .ROOT .GetROOT ()
104
- self .__old_state = groot .IsBatch ()
105
- if self .__old_state != self .__batch :
106
- groot .SetBatch ( self .__batch )
104
+ if groot :
105
+ self .__old_state = groot .IsBatch ()
106
+ if self .__old_state != self .__batch :
107
+ groot .SetBatch ( self .__batch )
107
108
return self
108
109
## context manager: EXIT
109
110
def __exit__ ( self , * _ ) :
110
111
groot = ROOT .ROOT .GetROOT ()
111
- if self .__old_state != groot .IsBatch () : root .SetBatch ( self .__old_state )
112
-
112
+ if groot and self .__old_state != groot .IsBatch () :
113
+ groot .SetBatch ( self .__old_state )
114
+
113
115
# =============================================================================
114
116
## check batch from environment variables, set it ans issue the message
115
117
def batch_env ( logger = logger ) :
You can’t perform that action at this time.
0 commit comments