Fix default port for smart tcp clients.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 14 Apr 2009 19:08:09 +0000 (19:08 +0000)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 14 Apr 2009 19:08:09 +0000 (19:08 +0000)
dulwich/client.py

index b2951cf6c4bc37259e80370ef02476a28059c888..a15668ba5757ba8b74684f22611ce3ac17fd1d2b 100644 (file)
@@ -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)