diff -r d60678a567a9 -r 328739ea70c3 mercurial/hg.py --- a/mercurial/hg.py Tue Jun 23 22:38:21 2015 -0700 +++ b/mercurial/hg.py Tue Jun 23 22:20:08 2015 -0700 @@ -202,7 +202,7 @@ requirements = '' try: requirements = srcrepo.vfs.read('requires') - except IOError, inst: + except IOError as inst: if inst.errno != errno.ENOENT: raise @@ -388,7 +388,7 @@ try: destpath = hgdir util.makedir(destpath, notindexed=True) - except OSError, inst: + except OSError as inst: if inst.errno == errno.EEXIST: cleandir = None raise util.Abort(_("destination '%s' already exists") @@ -428,7 +428,7 @@ try: destpeer = peer(srcrepo or ui, peeropts, dest, create=True) # only pass ui when no srcrepo - except OSError, inst: + except OSError as inst: if inst.errno == errno.EEXIST: cleandir = None raise util.Abort(_("destination '%s' already exists")