File: helper_install_progress_run.py

package info (click to toggle)
python-apt 3.1.0
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,064 kB
  • sloc: cpp: 10,312; python: 8,812; makefile: 94; sh: 17
file content (15 lines) | stat: -rwxr-xr-x 458 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python3
#
# Copyright (C) 2019 Colomban Wendling <cwendling@hypra.fr>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
"""Helper checking argv[1] is a valid, writable, file descriptor"""

import os
from sys import argv

assert len(argv) == 2
with os.fdopen(int(argv[1]), "w") as f:
    assert f.write("test") == 4