'Segment Analytics syntax error is causing my pytest suite to fail

I'm setting up a suite of unit tests via Pytest for an application, but when I run python -m pytest I get the error shown below. I don't believe it's from my application - instead, it seems to be coming from segment analytics; a service we use to track user analytics.

Am I incorrect in thinking this, and in either case, is there anything my team can do to fix this?

 platform win32 -- Python 3.9.0, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
    rootdir: C:\Users\erich\OneDrive\Desktop\Misc\sanctuary-fastapi
    plugins: anyio-3.5.0, cov-2.11.1
    collected 0 items / 1 error
    
    ==================================================================================== ERRORS ====================================================================================
    ____________________________________________________________________ ERROR collecting app/test_data_pull.py ____________________________________________________________________ 
    C:\Python39\lib\site-packages\_pytest\python.py:578: in _importtestmodule
        mod = import_path(self.fspath, mode=importmode)
    C:\Python39\lib\site-packages\_pytest\pathlib.py:531: in import_path
        importlib.import_module(module_name)
    C:\Python39\lib\importlib\__init__.py:127: in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    <frozen importlib._bootstrap>:1030: in _gcd_import
        ???
    <frozen importlib._bootstrap>:1007: in _find_and_load
        ???
    <frozen importlib._bootstrap>:986: in _find_and_load_unlocked
        ???
    <frozen importlib._bootstrap>:680: in _load_unlocked
        ???
    C:\Python39\lib\site-packages\_pytest\assertion\rewrite.py:170: in exec_module
        exec(co, module.__dict__)
    app\test_data_pull.py:2: in <module>
        import main
    app\main.py:7: in <module>
        import analytics
    E     File "C:\Python39\lib\site-packages\analytics\__init__.py", line 23
    E       except Exception, e:
    E                       ^
    E   SyntaxError: invalid syntax
    =========================================================================== short test summary info ============================================================================ 
    ERROR app/test_data_pull.py
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source