diff options
Diffstat (limited to 'Lib/distutils/tests/support.py')
-rw-r--r-- | Lib/distutils/tests/support.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py index 48bcbcc..ecc8da1 100644 --- a/Lib/distutils/tests/support.py +++ b/Lib/distutils/tests/support.py @@ -42,6 +42,19 @@ class TempdirManager(object): self.tempdirs.append(d) return d + def write_file(self, path, content): + """Writes a file in the given path. + + + path can be a string or a sequence. + """ + if isinstance(path, (list, tuple)): + path = os.path.join(*path) + f = open(path, 'w') + try: + f.write(content) + finally: + f.close() class DummyCommand: """Class to store options for retrieval via set_undefined_options().""" |