diff options
| author | Simeon Simeonov | 2018-09-12 22:17:45 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2018-09-12 22:17:45 +0200 |
| commit | 4c177e6eb71ab2b068f6426b9d141be47fc1f667 (patch) | |
| tree | cfa1e2ff0f8027a2cfeb8bccd2970b84fec31920 /cumount.py | |
| parent | f94c7dc1f3deb93f8efd3a02084ad17bad069280 (diff) | |
Python2 -> Python3
Diffstat (limited to 'cumount.py')
| -rwxr-xr-x | cumount.py | 13 |
1 files changed, 5 insertions, 8 deletions
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python3 |
| 2 | # -*- coding: utf-8 -*- | 2 | # -*- coding: utf-8 -*- |
| 3 | 3 | ||
| 4 | import json | 4 | import json |
| @@ -8,8 +8,7 @@ import sys | |||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | def main(): | 10 | def main(): |
| 11 | """ | 11 | |
| 12 | """ | ||
| 13 | if (len(sys.argv) != 2): | 12 | if (len(sys.argv) != 2): |
| 14 | sys.exit('Invalid parameter. Usage: {0} <mapping>\n'.format( | 13 | sys.exit('Invalid parameter. Usage: {0} <mapping>\n'.format( |
| 15 | sys.argv[0])) | 14 | sys.argv[0])) |
| @@ -56,11 +55,9 @@ def main(): | |||
| 56 | '-d', | 55 | '-d', |
| 57 | loop_device]) | 56 | loop_device]) |
| 58 | except subprocess.CalledProcessError as e: | 57 | except subprocess.CalledProcessError as e: |
| 59 | sys.stderr.write('Execution error: {0}\n'.format(e)) | 58 | print('Execution error: {0}\n'.format(e), file=sys.stderr, flush=True) |
| 60 | sys.stderr.flush() | 59 | except Exception: |
| 61 | except Exception as e: | 60 | print('Error: {0}\n'.format(cstm_error), file=sys.stderr, flush=True) |
| 62 | sys.stderr.write('Error: {0}\n'.format(cstm_error)) | ||
| 63 | sys.stderr.flush() | ||
| 64 | 61 | ||
| 65 | 62 | ||
| 66 | if __name__ == '__main__': | 63 | if __name__ == '__main__': |
