-if hasattr(filepath, "Permissions"):
- # filepath.Permissions was added in Twisted-11.1.0, but we're compatible
- # back to 11.0.0 (on windows). Fortunately we don't really need to
- # provide anything more than an int until Twisted-15.0.0 .
- class IntishPermissions(filepath.Permissions):
- def __init__(self, statModeInt):
- self.statModeInt = statModeInt
- filepath.Permissions.__init__(self, statModeInt)
- def __and__(self, other):
- return self.statModeInt & other
-else:
- IntishPermissions = lambda statModeInt: statModeInt
+# filepath.Permissions was added in Twisted-11.1.0, which we require. Twisted
+# <15.0.0 expected an int, and only does '&' on it. Twisted >=15.0.0 expects
+# a filepath.Permissions. This satisfies both.
+
+class IntishPermissions(filepath.Permissions):
+ def __init__(self, statModeInt):
+ self._tahoe_statModeInt = statModeInt
+ filepath.Permissions.__init__(self, statModeInt)
+ def __and__(self, other):
+ return self._tahoe_statModeInt & other