Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/ini.py @ 151:c46b0f82922a
FIX: INIConfigParser.read_file(): correctly document the requirements for the file argument for different Python versions
| author | Franz Glasner <hg@dom66.de> |
|---|---|
| date | Sat, 14 Apr 2018 17:11:41 +0200 |
| parents | 0ac6ffae969f |
| children | 139fb1d1ef54 |
comparison
equal
deleted
inserted
replaced
| 150:0ac6ffae969f | 151:c46b0f82922a |
|---|---|
| 74 raise NotImplementedError("use `read_file()' instead") | 74 raise NotImplementedError("use `read_file()' instead") |
| 75 | 75 |
| 76 def read_file(self, fp, filename): | 76 def read_file(self, fp, filename): |
| 77 """Read from a file-like object `fp`. | 77 """Read from a file-like object `fp`. |
| 78 | 78 |
| 79 The `fp` argument must be iterable. | 79 The `fp` argument must be iterable (Python 3.2+) or have a |
| 80 `readline()` method (Python 2, <3.2). | |
| 80 | 81 |
| 81 """ | 82 """ |
| 82 if hasattr(self, "filename"): | 83 if hasattr(self, "filename"): |
| 83 raise RuntimeError("already initialized") | 84 raise RuntimeError("already initialized") |
| 84 filename = os.path.normpath(os.path.abspath(filename)) | 85 filename = os.path.normpath(os.path.abspath(filename)) |
