Mercurial > ~astiob > upreckon > hgweb
comparison compat.py @ 116:e17ae4ccbc58 2.00
Removed code omitted in 2.00 releases from the 2.00 branch
| author | Oleg Oshmyan <chortos@inbox.lv> |
|---|---|
| date | Fri, 08 Apr 2011 20:22:38 +0300 |
| parents | cd347cfca272 |
| children |
comparison
equal
deleted
inserted
replaced
| 115:a28f84a8e603 | 116:e17ae4ccbc58 |
|---|---|
| 128 return _path.curdir | 128 return _path.curdir |
| 129 return _path.join(*rel_list) | 129 return _path.join(*rel_list) |
| 130 | 130 |
| 131 _path.relpath = relpath | 131 _path.relpath = relpath |
| 132 | 132 |
| 133 def import_urllib(): | |
| 134 try: | |
| 135 # Python 3 | |
| 136 import urllib.request | |
| 137 return urllib.request, lambda url: urllib.request.urlopen(url).read().decode('ascii') | |
| 138 except ImportError: | |
| 139 # Python 2 | |
| 140 import urllib | |
| 141 return urllib, lambda url: urllib.urlopen(url).read() | |
| 142 | |
| 143 try: | 133 try: |
| 144 from abc import ABCMeta, abstractmethod | 134 from abc import ABCMeta, abstractmethod |
| 145 except ImportError: | 135 except ImportError: |
| 146 ABCMeta, abstractmethod = None, lambda x: x | 136 ABCMeta, abstractmethod = None, lambda x: x |
| 147 | 137 |
