minor fixes
This commit is contained in:
parent
effe001115
commit
6d87cb3980
3 changed files with 5 additions and 4 deletions
|
|
@ -42,9 +42,9 @@ class File:
|
|||
|
||||
import stat
|
||||
if stat.S_ISBLK(st.st_mode):
|
||||
if sys.platform in ('win32',):
|
||||
die(2, 'Access to raw block devices not supported on platform {sys.platform!r}')
|
||||
mode = (os.O_RDONLY,os.O_RDWR)[bool(write)]
|
||||
if sys.platform == 'win32':
|
||||
mode |= os.O_BINARY
|
||||
try:
|
||||
fd = os.open(fn, mode)
|
||||
except OSError as e:
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@ def _check_file_type_and_access(fname,ftype,blkdev_ok=False):
|
|||
(stat.S_ISLNK,'symbolic link')
|
||||
]
|
||||
if blkdev_ok:
|
||||
ok_types.append((stat.S_ISBLK,'block device'))
|
||||
if not sys.platform in ('win32',):
|
||||
ok_types.append((stat.S_ISBLK, 'block device'))
|
||||
|
||||
try:
|
||||
mode = os.stat(fname).st_mode
|
||||
|
|
|
|||
|
|
@ -345,5 +345,5 @@ if cfg.fork:
|
|||
|
||||
from mmgen.main import launch
|
||||
start_time = int(time.time())
|
||||
launch(func=lambda: main())
|
||||
launch(func=main)
|
||||
end_msg(int(time.time()) - start_time)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue