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

Documentation on exception handling syntax error #735

Open
dubidubno opened this issue Jul 26, 2023 · 0 comments
Open

Documentation on exception handling syntax error #735

dubidubno opened this issue Jul 26, 2023 · 0 comments

Comments

@dubidubno
Copy link

From the documentation at https://pyyaml.org/wiki/PyYAMLDocumentation:

try:
    config = yaml.load(file('config.yaml', 'r'))
except yaml.YAMLError, exc:
    print "Error in configuration file:", exc

This gives an error on Python 3.11:

SyntaxError: multiple exception types must be parenthesized

Maybe it should be changed to except yaml.YAMLError as exc: .

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

1 participant