should use os.path.lexist instead of os.path.exist

The logic of the program requires a check on the existence of the
link itself

See repo  issue #125  :
        https://code.google.com/p/git-repo/issues/detail?id=125

Change-Id: Ia7300d22d6d656259f47c539febf1597f0c35538
This commit is contained in:
Sebastian Frias 2012-11-21 19:09:25 +01:00
parent 3f5ea0b182
commit 223bf963f0

View File

@ -118,11 +118,11 @@ class XmlManifest(object):
self.Override(name) self.Override(name)
try: try:
if os.path.exists(self.manifestFile): if os.path.lexists(self.manifestFile):
os.remove(self.manifestFile) os.remove(self.manifestFile)
os.symlink('manifests/%s' % name, self.manifestFile) os.symlink('manifests/%s' % name, self.manifestFile)
except OSError: except OSError as e:
raise ManifestParseError('cannot link manifest %s' % name) raise ManifestParseError('cannot link manifest %s: %s' % (name, str(e)))
def _RemoteToXml(self, r, doc, root): def _RemoteToXml(self, r, doc, root):
e = doc.createElement('remote') e = doc.createElement('remote')