Permalink
Browse files
Implement test -e and test -h (#45)
- Loading branch information...
Showing
with
6 additions
and
0 deletions.
-
+6
−0
core/expr_eval.py
|
|
@@ -485,6 +485,9 @@ def Eval(self, node): |
|
|
#self._AddErrorContext("Error from stat(%r): %s" % (s, e))
|
|
|
return False
|
|
|
|
|
|
if op_id == Id.BoolUnary_e:
|
|
|
return True
|
|
|
|
|
|
if op_id == Id.BoolUnary_f:
|
|
|
return stat.S_ISREG(mode)
|
|
|
|
|
|
@@ -500,6 +503,9 @@ def Eval(self, node): |
|
|
if op_id == Id.BoolUnary_w:
|
|
|
return os.access(s, os.W_OK)
|
|
|
|
|
|
if op_id == Id.BoolUnary_h:
|
|
|
return stat.S_ISLNK(mode)
|
|
|
|
|
|
raise NotImplementedError(op_id)
|
|
|
|
|
|
if arg_type == OperandType.Str:
|
|
|
|
0 comments on commit
b01362d