Describe the bug
When importing pycatia with python 3.9, it raises a TypeError due to an annotation syntax introduced in python 3.10 :
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\...\lib\site-packages\pycatia\__init__.py", line 21, in <module>
from pycatia.base_interfaces.base_application import catia_application as catia
File "C:\...\lib\site-packages\pycatia\base_interfaces\base_application.py", line 5, in <module>
from pycatia.in_interfaces.application import Application
File "C:\...\lib\site-packages\pycatia\in_interfaces\application.py", line 10, in <module>
from pycatia.in_interfaces.document import Document
File "C:\...\lib\site-packages\pycatia\in_interfaces\document.py", line 17, in <module>
from pycatia.in_interfaces.cameras import Cameras
File "C:\...\lib\site-packages\pycatia\in_interfaces\cameras.py", line 13, in <module>
from pycatia.in_interfaces.camera import Camera
File "C:\...\lib\site-packages\pycatia\in_interfaces\camera.py", line 12, in <module>
from pycatia.system_interfaces.any_object import AnyObject
File "C:\...\lib\site-packages\pycatia\system_interfaces\any_object.py", line 13, in <module>
from pycatia.base_interfaces.pycatia import PyCATIA
File "C:\...\lib\site-packages\pycatia\base_interfaces\pycatia.py", line 5, in <module>
from pycatia.cat_logger import create_logger
File "C:\...\lib\site-packages\pycatia\cat_logger.py", line 9, in <module>
def has_level_handler(logger: logging.Logger | None):
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
To Reproduce
With python 3.9 and pycatia 0.6.6, import pycatia :
import pycatia
Expected behavior
No exception :)
Desktop (please complete the following information):
OS: Windows 11
CATIA V5 version: rCxR1 (?)
pycatia version: 0.6.6
python version: 3.9.18
Additional context
Known solution: replace logging.Logger | None by Optional[logging.Logger] in the file cat_logger.py, line 9
Describe the bug When importing pycatia with python 3.9, it raises a TypeError due to an annotation syntax introduced in python 3.10 :
To Reproduce With python 3.9 and pycatia 0.6.6, import pycatia :
Expected behavior No exception :)
Desktop (please complete the following information):
Additional context Known solution: replace
logging.Logger | None
byOptional[logging.Logger]
in the file cat_logger.py, line 9