Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import error TypeError: unsupported operand type(s) for |: 'type' and 'type' #26

Closed
christopherpickering opened this issue Aug 30, 2022 · 2 comments

Comments

@christopherpickering
Copy link

Hi! I'm trying to use this package with the Biblelator and getting an error:

Traceback (most recent call last):
  File "/3.9.0/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/3.9.0/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/projects/BiblelatorFiles/Biblelator/Biblelator.py", line 49, in <module>
    from BibleOrgSys import BibleOrgSysGlobals
  File "/3.9.0/lib/python3.9/site-packages/BibleOrgSys/BibleOrgSysGlobals.py", line 1408, in <module>
    def setVerbosity( verbosityLevelParameter: str | int ) -> None:
TypeError: unsupported operand type(s) for |: 'type' and 'type'

def setVerbosity( verbosityLevelParameter: str | int ) -> None:

I'm thinking this line should be:

def setVerbosity( verbosityLevelParameter: Union[str, int] ) -> None:
@RobH123
Copy link
Contributor

RobH123 commented Sep 3, 2022

Hi there. What Python version are you running? ('python3 --version' shows 3.10.4 on my Ubuntu laptop). I think that syntax came in with v3.10 IIRC.

@christopherpickering
Copy link
Author

Hi Rob, Ah, nice, I was in 3.9. I'll give it a shot in 3.10. Thats some new fancy syntax for python 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants