* Fix windows line endings * Avoid permission error when removing temporary directory * Use trimEnd * Use explicit line ending replacement
@@ -75,5 +75,8 @@ export function run(
if (value === null) {
return '';
}
- return value.toString().replace(/\n$/, '');
+ return value
+ .toString()
+ .replace(/(\r\n|\n)$/, '')
+ .trim();
@@ -124,7 +124,10 @@ class _test_env(object):
def stop(self):
self.env_patch.stop()
self.path_patch.stop()
- self.test_dir.cleanup()
+ try:
+ self.test_dir.cleanup()
+ except PermissionError as e:
+ pass
def __enter__(self):
self.start()