Browse Source

更新 'backup/preset/app/git.py'

junhuanchen 1 year ago
parent
commit
9bc149dbb2
1 changed files with 3 additions and 3 deletions
  1. 3 3
      backup/preset/app/git.py

+ 3 - 3
backup/preset/app/git.py

@@ -5,7 +5,7 @@ from dulwich import porcelain
 from dulwich.porcelain import get_remote_repo
 from dulwich.repo import Repo
 from dulwich.walk import Walker
-import urllib.request
+import requests
 
 def ro():
     os.system("/etc/init.d/S01mount_ro start")
@@ -91,8 +91,8 @@ def isOnline(localRep):
     r = Repo(localRep)
     (remote_name, remote_location) = get_remote_repo(r, None)
     try:
-        response = urllib.request.urlopen(remote_location, timeout=0)
-        if response.status == 200:
+        response = requests.get(remote_location)
+        if response.status_code == 200:
             # print("Connection successful.")
             return True
         else: