GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
go4init.py
Go to the documentation of this file.
2"""
3Add PyROOT-bound go4 object to builtins
4this allows it to be accessed inside imported modules, cf. go4py.go4.go4Wrapper
5"""
6
7
8try:
9 go4
10except NameError as e:
11 msg = "Are you importing go4init outside of Go4?"
12 a = list(e.args)
13 a[0] += "\n" + " " * len("NameError: ") + msg
14 e.args = tuple(a)
15 raise
16
17try:
18 import __builtin__
19except ImportError:
20 import builtins as __builtin__ # name change in p3
21
22__builtin__.go4 = go4