osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-dev/+/42901?usp=email )

Change subject: src/grd: use sys.exit
......................................................................

src/grd: use sys.exit

The exit function is a constant from the site module, which "should not
be used in programs". Replace it with sys.exit()

Related: 
https://docs.python.org/3/library/constants.html#constants-added-by-the-site-module
Change-Id: I95db013e36242d5126ce07b8a392e6dc0a0ecfdd
---
M src/grd
1 file changed, 7 insertions(+), 6 deletions(-)

Approvals:
  daniel: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved




diff --git a/src/grd b/src/grd
index 64de140..d86225d 100755
--- a/src/grd
+++ b/src/grd
@@ -8,8 +8,9 @@
 import json
 import os
 import subprocess
-import urllib.request
+import sys
 import urllib.parse
+import urllib.request


 def get_topdir():
@@ -22,14 +23,14 @@
         ).stdout.rstrip()
     except subprocess.CalledProcessError:
         print("ERROR: not running inside a git repository")
-        exit(1)
+        sys.exit(1)


 def get_config_path():
     ret = f"{get_topdir()}/.gitreview"
     if not os.path.exists(ret):
         print(f"ERROR: config not found: {ret}")
-        exit(1)
+        sys.exit(1)
     return ret


@@ -72,7 +73,7 @@
     try:
         return subprocess.run(cmd, check=True)
     except subprocess.CalledProcessError:
-        exit(1)
+        sys.exit(1)


 def git_cherry_pick_fetch_head():
@@ -82,7 +83,7 @@
     try:
         return subprocess.run(cmd, check=True)
     except subprocess.CalledProcessError:
-        exit(1)
+        sys.exit(1)


 def git_checkout_fetch_head(patch_id, rev):
@@ -92,7 +93,7 @@
     try:
         return subprocess.run(cmd, check=True)
     except subprocess.CalledProcessError:
-        exit(1)
+        sys.exit(1)


 desc = "git review download: fetch and checkout a patch from gerrit"

--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/42901?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I95db013e36242d5126ce07b8a392e6dc0a0ecfdd
Gerrit-Change-Number: 42901
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>

Reply via email to