Skip to content

Commit 728656c

Browse files
committed
cli: Refactor old test to avoid fcntl
This is a simple preparation for the next commit, to get rid of low-level `fcntl.fcntl()` calls, since `os.set_blocking()` now exists (since Python 3.5).
1 parent c20f191 commit 728656c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/test_cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# You should have received a copy of the GNU General Public License
1414
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515

16-
import fcntl
1716
import locale
1817
import os
1918
import pty
@@ -510,8 +509,7 @@ def test_run_default_format_output_in_tty(self):
510509

511510
# Read output from TTY
512511
output = os.fdopen(master, 'r')
513-
flag = fcntl.fcntl(master, fcntl.F_GETFD)
514-
fcntl.fcntl(master, fcntl.F_SETFL, flag | os.O_NONBLOCK)
512+
os.set_blocking(master, False)
515513

516514
out = output.read().replace('\r\n', '\n')
517515

0 commit comments

Comments
 (0)