What is the best way to get the current APRX in a Python Toolbox (.pyt) tool? I've found that if I use arcpy.mp.ArcGISProject("CURRENT") then the initial loading of the toolboxes will results in the error below. If I right click on the toolbox and refresh then everything works fine until the next time I close and re-open the APRX.
Traceback (most recent call last):
File "<string>", line 100, in __init__
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py", line 536, in __init__
self._arc_object = arcgisscripting._mapping.ArcGISProject(*gp_fixargs((aprx_path,), True))
OSError: CURRENT