Skip to content

Commit de3b963

Browse files
committed
Moved test-centric windows specific fix into the class itself to assure this kind of issue doesn't popup for anyone
1 parent 258403d commit de3b963

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

lib/git/remote.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
join,
2626
)
2727
import re
28+
import os
2829

2930
__all__ = ('RemoteProgress', 'PushInfo', 'FetchInfo', 'Remote')
3031

@@ -418,6 +419,16 @@ def __init__(self, repo, name):
418419
self.repo = repo
419420
self.name = name
420421

422+
if os.name == 'nt':
423+
# some oddity: on windows, python 2.5, it for some reason does not realize
424+
# that it has the config_writer property, but instead calls __getattr__
425+
# which will not yield the expected results. 'pinging' the members
426+
# with a dir call creates the config_writer property that we require
427+
# ... bugs like these make me wonder wheter python really wants to be used
428+
# for production. It doesn't happen on linux though.
429+
dir(self)
430+
# END windows special handling
431+
421432
def __getattr__(self, attr):
422433
"""Allows to call this instance like
423434
remote.special( *args, **kwargs) to call git-remote special self.name"""

test/testlib/helper.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,6 @@ def remote_repo_creator(self):
188188
d_remote.fetch()
189189
remote_repo_url = "git://localhost%s" % remote_repo_dir
190190

191-
# some oddity: on windows, python 2.5, it for some reason does not realize
192-
# that it has the config_writer property, but instead calls __getattr__
193-
# which will not yield the expected results. 'pinging' the members
194-
# with a dir call creates the config_writer property that we require
195-
# ... bugs like these make me wonder wheter python really wants to be used
196-
# for production. It doesn't happen on linux though.
197-
dir(d_remote)
198191
d_remote.config_writer.set('url', remote_repo_url)
199192

200193
# try to list remotes to diagnoes whether the server is up

0 commit comments

Comments
 (0)