Mercurial > hg
comparison mercurial/util.py @ 31841:9ff5a124d111
py3: replace str() with bytes()
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 07 Apr 2017 13:46:35 +0530 |
parents | d955b02d8ec6 |
children | 4d0465dd13d2 |
comparison
equal
deleted
inserted
replaced
31840:7973e0a15bd4 | 31841:9ff5a124d111 |
---|---|
2797 | 2797 |
2798 def authinfo(self): | 2798 def authinfo(self): |
2799 user, passwd = self.user, self.passwd | 2799 user, passwd = self.user, self.passwd |
2800 try: | 2800 try: |
2801 self.user, self.passwd = None, None | 2801 self.user, self.passwd = None, None |
2802 s = str(self) | 2802 s = bytes(self) |
2803 finally: | 2803 finally: |
2804 self.user, self.passwd = user, passwd | 2804 self.user, self.passwd = user, passwd |
2805 if not self.user: | 2805 if not self.user: |
2806 return (s, None) | 2806 return (s, None) |
2807 # authinfo[1] is passed to urllib2 password manager, and its | 2807 # authinfo[1] is passed to urllib2 password manager, and its |
2852 def hidepassword(u): | 2852 def hidepassword(u): |
2853 '''hide user credential in a url string''' | 2853 '''hide user credential in a url string''' |
2854 u = url(u) | 2854 u = url(u) |
2855 if u.passwd: | 2855 if u.passwd: |
2856 u.passwd = '***' | 2856 u.passwd = '***' |
2857 return str(u) | 2857 return bytes(u) |
2858 | 2858 |
2859 def removeauth(u): | 2859 def removeauth(u): |
2860 '''remove all authentication information from a url string''' | 2860 '''remove all authentication information from a url string''' |
2861 u = url(u) | 2861 u = url(u) |
2862 u.user = u.passwd = None | 2862 u.user = u.passwd = None |