Просмотр исходного кода

Fix default port for smart tcp clients.

Jelmer Vernooij 16 лет назад
Родитель
Сommit
b342331111
1 измененных файлов с 3 добавлено и 1 удалено
  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)