equal
deleted
inserted
replaced
3 # Copyright FUJIWARA Katsunori <foozy@lares.dti.ne.jp> and others |
3 # Copyright FUJIWARA Katsunori <foozy@lares.dti.ne.jp> and others |
4 # |
4 # |
5 # This software may be used and distributed according to the terms of the |
5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. |
6 # GNU General Public License version 2 or any later version. |
7 |
7 |
8 |
|
9 import errno |
|
10 |
8 |
11 from . import encoding |
9 from . import encoding |
12 |
10 |
13 |
11 |
14 def mayhavepending(root): |
12 def mayhavepending(root): |
27 This returns '(fp, is_pending_opened)' tuple. |
25 This returns '(fp, is_pending_opened)' tuple. |
28 """ |
26 """ |
29 if mayhavepending(root): |
27 if mayhavepending(root): |
30 try: |
28 try: |
31 return (vfs(b'%s.pending' % filename, **kwargs), True) |
29 return (vfs(b'%s.pending' % filename, **kwargs), True) |
32 except IOError as inst: |
30 except FileNotFoundError: |
33 if inst.errno != errno.ENOENT: |
31 pass |
34 raise |
|
35 return (vfs(filename, **kwargs), False) |
32 return (vfs(filename, **kwargs), False) |