133794m3r / 133794m3r/text_adventure

Modify the module import to use try except.

未关闭
#12 0 条评论 0 个 reaction 已指派 2 人 已被 @rsd1244 认领 在 GitHub 查看
enhancement good first issue
主要语言
Python
星标
1
派生
1
PR 合并指标
30 天内没有已合并 PR

描述

This issue will track if I"m already using try except if the module is already imported or not. It will avoid importing the same module over and over again since python does not let you do ifndef you have to wrap it in a try except block.

try:
module
except NameError:
import module

Do this for each module as it's being imported to see if we've not already gotten it. This way we can check if it's already there. This should've already been covered but SO guys didn't tell me how to do this which is what I wanted to do but oh well my hack needs to be fixed.

贡献指南

这个仓库没有索引到贡献指南

调研方向

在代码库中找到所有模块导入,并将其替换为 try-except 块以避免重复导入。首先在 Python 文件中搜索 'import' 语句。更改后,运行游戏以确保其仍能正常工作。该 issue 未指定要修改哪些文件。

由索引模型根据 Issue 内容生成。

评估

领域
backend
Issue 类型
重构
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。