PrakharPythonProgrammer / Grail-0.6

This is the Project Grail-0.6 version released in the year 1999 and we're trying to port this from Python 1 to Python 3.
Other
21 stars 6 forks source link

UndefinedStyle #4

Closed PrakharPythonProgrammer closed 3 years ago

PrakharPythonProgrammer commented 3 years ago

I have searched on internet and as far as my knowledge there is no exception like UndefinedStyle. Can you tell @gvanrossum what kind of error did you want it to handle ? Maybe the name for that exception is changed.

gvanrossum commented 3 years ago

It's an exception defined in Stylesheet.py. In Python 1, exceptions were just string literals.

PrakharPythonProgrammer commented 3 years ago

That means we cannot use it in Python 3 ?

On Tue, May 18, 2021, 08:33 Guido van Rossum @.***> wrote:

It's an exception defined in Stylesheet.py. In Python 1, exceptions were just string literals.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PrakharPythonProgrammer/Grail-0.6/issues/4#issuecomment-842789707, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUCW2RZMJIHKL7S5H7P36ELTOHKJJANCNFSM45BTAOTA .

gvanrossum commented 3 years ago

No, you just change this line:

UndefinedStyle = 'UndefinedStyle'

into this:

class UndefinedStyle(Exception):
    pass
PrakharPythonProgrammer commented 3 years ago

Okay I got it we are inheriting the Exception class which is the base class of every exception. Thank you :)

On Tue, May 18, 2021, 09:34 Guido van Rossum @.***> wrote:

No, you just change this line:

UndefinedStyle = 'UndefinedStyle'

into this:

class UndefinedStyle(Exception): pass

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PrakharPythonProgrammer/Grail-0.6/issues/4#issuecomment-842807960, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUCW2RY2DMTDL5CGMI3MAF3TOHRLNANCNFSM45BTAOTA .