Mercurial > hg
comparison tests/test-inherit-mode.t @ 48876:42d2b31cee0b
tests: remove from __future__ from inline Python in tests
This is no longer required since we require Python 3 and the linter
no longer requires these statements.
Differential Revision: https://phab.mercurial-scm.org/D12255
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 20 Feb 2022 15:28:44 -0700 |
parents | 7ee07e1a25c0 |
children | e358f6e0e50e |
comparison
equal
deleted
inserted
replaced
48875:6000f5b25c9b | 48876:42d2b31cee0b |
---|---|
8 | 8 |
9 $ chmod g-s dir | 9 $ chmod g-s dir |
10 $ cd dir | 10 $ cd dir |
11 | 11 |
12 $ cat >printmodes.py <<EOF | 12 $ cat >printmodes.py <<EOF |
13 > from __future__ import absolute_import, print_function | |
14 > import os | 13 > import os |
15 > import sys | 14 > import sys |
16 > | 15 > |
17 > allnames = [] | 16 > allnames = [] |
18 > isdir = {} | 17 > isdir = {} |
29 > suffix = name in isdir and '/' or '' | 28 > suffix = name in isdir and '/' or '' |
30 > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix)) | 29 > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix)) |
31 > EOF | 30 > EOF |
32 | 31 |
33 $ cat >mode.py <<EOF | 32 $ cat >mode.py <<EOF |
34 > from __future__ import absolute_import, print_function | |
35 > import os | 33 > import os |
36 > import sys | 34 > import sys |
37 > print('%05o' % os.lstat(sys.argv[1]).st_mode) | 35 > print('%05o' % os.lstat(sys.argv[1]).st_mode) |
38 > EOF | 36 > EOF |
39 | 37 |