(x, fp, contents='')
| 113 | |
| 114 | |
| 115 | def _x_file(x, fp, contents=''): |
| 116 | assert not IS_PY2 or isinstance(contents, unicode) |
| 117 | |
| 118 | if not contents: |
| 119 | contents = fp |
| 120 | dirs, _ = os.path.split(fp) |
| 121 | if dirs and not os.path.exists(dirs): |
| 122 | os.makedirs(dirs) |
| 123 | with io.open(fp, mode=x, encoding=ENCODING) as f: |
| 124 | f.write(contents) |
no outgoing calls
no test coverage detected