|
1 |
| -# Based on turtle.py, a Tkinter based turtle graphics module for Python |
2 |
| -# Version 1.1b - 4. 5. 2009 |
3 |
| -# Copyright (C) 2006 - 2010 Gregor Lingl |
4 |
| - |
| 1 | +# SPDX-FileCopyrightText: 2006-2010 Gregor Lingl for Adafruit Industries |
| 2 | +# SPDX-FileCopyrightText: 2019 LadyAda for Adafruit Industries |
| 3 | +# SPDX-FileCopyrightText: 2021 Dave Astels for Adafruit Industries |
5 | 4 | #
|
6 |
| -# The MIT License (MIT) |
7 |
| -# |
8 |
| -# Copyright (c) 2019 LadyAda and Dave Astels for Adafruit Industries |
9 |
| -# |
10 |
| -# Permission is hereby granted, free of charge, to any person obtaining a copy |
11 |
| -# of this software and associated documentation files (the "Software"), to deal |
12 |
| -# in the Software without restriction, including without limitation the rights |
13 |
| -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
14 |
| -# copies of the Software, and to permit persons to whom the Software is |
15 |
| -# furnished to do so, subject to the following conditions: |
16 |
| -# |
17 |
| -# The above copyright notice and this permission notice shall be included in |
18 |
| -# all copies or substantial portions of the Software. |
19 |
| -# |
20 |
| -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
21 |
| -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
22 |
| -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
23 |
| -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
24 |
| -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
25 |
| -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
26 |
| -# THE SOFTWARE. |
| 5 | +# SPDX-License-Identifier: MIT |
| 6 | + |
27 | 7 | """
|
28 | 8 | `adafruit_turtle`
|
29 | 9 | ================================================================================
|
@@ -115,7 +95,7 @@ class Vec2D(tuple):
|
115 | 95 | # |a| absolute value of a
|
116 | 96 | # a.rotate(angle) rotation
|
117 | 97 | def __init__(self, x, y):
|
118 |
| - super(Vec2D, self).__init__((x, y)) |
| 98 | + super().__init__((x, y)) |
119 | 99 |
|
120 | 100 | def __add__(self, other):
|
121 | 101 | return Vec2D(self[0] + other[0], self[1] + other[1])
|
@@ -168,8 +148,10 @@ def __init__(self, display=None, scale=1):
|
168 | 148 | else:
|
169 | 149 | try:
|
170 | 150 | self._display = board.DISPLAY
|
171 |
| - except AttributeError: |
172 |
| - raise RuntimeError("No display available. One must be provided.") |
| 151 | + except AttributeError as err: |
| 152 | + raise RuntimeError( |
| 153 | + "No display available. One must be provided." |
| 154 | + ) from err |
173 | 155 |
|
174 | 156 | self._w = self._display.width
|
175 | 157 | self._h = self._display.height
|
|
0 commit comments