style: remove unused imports and variables in project.py

Remove unused import and exception variable flagged by ruff:
- Remove unused 'sys' import (F401)
- Remove unused exception variable 'e' in except clause (F841)

Co-Authored-By: Yue Guobin <yueguobin@outlook.com>
This commit is contained in:
YueGuobin 2026-03-10 01:08:20 +08:00
parent c0aec3f979
commit 7d031a6802

View File

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import re
import os
import json
@ -526,7 +525,7 @@ class Project:
name = base_name.format(number, id=number, name="Node")
except KeyError as e:
raise ControllerError("{" + e.args[0] + "} is not a valid replacement string in the node name")
except (ValueError, IndexError) as e:
except (ValueError, IndexError):
raise ControllerError(f"{base_name} is not a valid replacement string in the node name")
if name not in self._allocated_node_names:
self._allocated_node_names.add(name)