Use ImportError.

New class syntax.
This commit is contained in:
Guido van Rossum 1991-12-26 13:03:52 +00:00
parent 869100a919
commit 2234bc9101
2 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@
# formatting, along the lines of TeX; for now, a very simple model # formatting, along the lines of TeX; for now, a very simple model
# is sufficient. # is sufficient.
# #
class formatter(): class formatter:
# #
# Initialize a formatter instance. # Initialize a formatter instance.
# Pass the window's drawing object, and left, top, right # Pass the window's drawing object, and left, top, right
@ -160,7 +160,7 @@ def test():
# Mac font assignments: # Mac font assignments:
font1 = 'times', '', 12 font1 = 'times', '', 12
font2 = 'times', 'b', 14 font2 = 'times', 'b', 14
except NameError: except ImportError:
# X11R4 font assignments # X11R4 font assignments
font1 = '*times-medium-r-*-120-*' font1 = '*times-medium-r-*-120-*'
font2 = '*times-bold-r-*-140-*' font2 = '*times-bold-r-*-140-*'

View File

@ -7,7 +7,7 @@
# formatting, along the lines of TeX; for now, a very simple model # formatting, along the lines of TeX; for now, a very simple model
# is sufficient. # is sufficient.
# #
class formatter(): class formatter:
# #
# Initialize a formatter instance. # Initialize a formatter instance.
# Pass the window's drawing object, and left, top, right # Pass the window's drawing object, and left, top, right
@ -160,7 +160,7 @@ def test():
# Mac font assignments: # Mac font assignments:
font1 = 'times', '', 12 font1 = 'times', '', 12
font2 = 'times', 'b', 14 font2 = 'times', 'b', 14
except NameError: except ImportError:
# X11R4 font assignments # X11R4 font assignments
font1 = '*times-medium-r-*-120-*' font1 = '*times-medium-r-*-120-*'
font2 = '*times-bold-r-*-140-*' font2 = '*times-bold-r-*-140-*'