Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/compat.py @ 209:c8d071581a4c
Doc: adjust documentation of configmix.compat slightly
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 05 May 2019 18:47:12 +0200 |
| parents | bbe8513ea649 |
| children | 13711ba8e81e |
comparison
equal
deleted
inserted
replaced
| 208:bbe8513ea649 | 209:c8d071581a4c |
|---|---|
| 50 | 50 |
| 51 | 51 |
| 52 def u2fs(s, force=False): | 52 def u2fs(s, force=False): |
| 53 """Convert a text (Unicode) string to the filesystem encoding. | 53 """Convert a text (Unicode) string to the filesystem encoding. |
| 54 | 54 |
| 55 .. note:: The filesystem encoding on Python 3 is a Unicode text | |
| 56 string. The function is a noop when called on Python 3. | |
| 57 | |
| 55 .. note:: If `s` is already a byte string be permissive and | 58 .. note:: If `s` is already a byte string be permissive and |
| 56 return `s` unchanged. | 59 return `s` unchanged. |
| 57 | 60 |
| 58 """ | 61 """ |
| 59 if isinstance(s, str): | 62 if isinstance(s, str): |
| 84 """Convert a text (Unicode) string to the filesystem encoding. | 87 """Convert a text (Unicode) string to the filesystem encoding. |
| 85 | 88 |
| 86 .. note:: The filesystem encoding on Python 3 is a Unicode text | 89 .. note:: The filesystem encoding on Python 3 is a Unicode text |
| 87 string. The function is a noop when called on Python 3. | 90 string. The function is a noop when called on Python 3. |
| 88 | 91 |
| 92 .. note:: If `s` is already a byte string be permissive and | |
| 93 return `s` unchanged. | |
| 94 | |
| 89 """ | 95 """ |
| 90 assert isinstance(s, str) | 96 assert isinstance(s, str) |
| 91 return s | 97 return s |
