Browse Source

Fix default port for smart tcp clients.

Jelmer Vernooij 16 năm trước cách đây
mục cha
commit
b342331111
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      dulwich/client.py

+ 3 - 1
dulwich/client.py

@@ -178,8 +178,10 @@ class GitClient(object):
 class TCPGitClient(GitClient):
     """A Git Client that works over TCP directly (i.e. git://)."""
 
-    def __init__(self, host, port=TCP_GIT_PORT, *args, **kwargs):
+    def __init__(self, host, port=None, *args, **kwargs):
         self._socket = socket.socket(type=socket.SOCK_STREAM)
+        if port is None:
+            port = TCP_GIT_PORT
         self._socket.connect((host, port))
         self.rfile = self._socket.makefile('rb', -1)
         self.wfile = self._socket.makefile('wb', 0)