Skip to content

Commit

Permalink
[CodeStyle][task 14] enable Ruff PLR1722 rule in python/paddle/base (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooo-create authored Sep 20, 2023
1 parent a98e997 commit ab4a6f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ ignore = [
"UP030",
"F522",
"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

0 comments on commit ab4a6f9

Please sign in to comment.