Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeStyle][task 14] enable Ruff PLR1722 rule in python/paddle/base #57401

Merged
merged 4 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ ignore = [
"C408",
"UP030",
"F403",
"PLR1722",
"C405",
"C417",
"PLR0402",
Expand Down
9 changes: 5 additions & 4 deletions python/paddle/base/device_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Definition of device workers."""
import sys

__all__ = [
'DeviceWorker',
Expand Down Expand Up @@ -111,7 +112,7 @@ def _gen_worker_desc(self, trainer_desc):
print("device worker program id:", program_id)
if self._program is None:
print("program of current device worker is not configured")
exit(-1)
sys.exit(-1)
opt_info = self._program._fleet_opt
# when opt_info is None or empty dict, it should return
if not opt_info:
Expand Down Expand Up @@ -261,7 +262,7 @@ def _gen_worker_desc(self, trainer_desc):
print("device worker program id:", program_id)
if self._program is None:
print("program of current device worker is not configured")
exit(-1)
sys.exit(-1)
opt_info = self._program._fleet_opt
# when opt_info is None or empty dict, it should return
if not opt_info:
Expand Down Expand Up @@ -394,7 +395,7 @@ def _gen_worker_desc(self, trainer_desc):
program_id = str(id(self._program))
if self._program is None:
print("program of current device worker is not configured")
exit(-1)
sys.exit(-1)
opt_info = self._program._fleet_opt
program_configs = opt_info["program_configs"]
downpour = trainer_desc.downpour_param
Expand Down Expand Up @@ -513,7 +514,7 @@ def _gen_worker_desc(self, trainer_desc):
program_id = str(id(self._program))
if self._program is None:
print("program of current device worker is not configured")
exit(-1)
sys.exit(-1)
opt_info = self._program._fleet_opt
program_configs = opt_info["program_configs"]
downpour = trainer_desc.downpour_param
Expand Down