I have built an ArcGIS toolbox for ArcMap 10.3. The tool works fine. However, sometimes I am receiving an error (attached below) and to enable the use of the toolbox I have to restart ArcMap and import the toolbox again. I do not know what is wrong in line 47 in the script - which is according to the message responsible for the error, because when I added few additional lines in the code the error still appear in line 47 (doesn't matter what is in this line). Does anyone know what should I do to correct this error?