diff options
| author | Magnus Hagander | 2018-12-15 10:05:34 +0000 |
|---|---|---|
| committer | Magnus Hagander | 2018-12-15 10:05:34 +0000 |
| commit | d3cbef33ecc739a7fea78ab21ea097178c204f91 (patch) | |
| tree | b56248a4d520e13197491b53eb0b3feec2d0e3b6 /tools | |
| parent | f01500dcf70022e2d23b91c147a6254ac8c4e3b2 (diff) | |
Replace usage of has_key()
It has been deprecated, and instead we should use "in" and "not in", so
make that change across the board.
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/deploystatic/deploystatic.py | 6 | ||||
| -rwxr-xr-x | tools/paypal/oneoff/backfill_paypal_fees.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tools/deploystatic/deploystatic.py b/tools/deploystatic/deploystatic.py index 31260652..2ea1e417 100755 --- a/tools/deploystatic/deploystatic.py +++ b/tools/deploystatic/deploystatic.py @@ -118,13 +118,13 @@ class TarWrapper(object): self.tarstruct[m.name] = m def isdir(self, d): - return self.tarstruct.has_key(d) and self.tarstruct[d].isdir() + return d in self.tarstruct and self.tarstruct[d].isdir() def isfile(self, f): - return self.tarstruct.has_key(f) and self.tarstruct[f].isfile() + return f in self.tarstruct and self.tarstruct[f].isfile() def readfile(self, src): - if self.tarstruct.has_key(src) and self.tarstruct[src].isfile(): + if src in self.tarstruct and self.tarstruct[src].isfile(): return self.tarfile.extractfile(src).read() else: return None diff --git a/tools/paypal/oneoff/backfill_paypal_fees.py b/tools/paypal/oneoff/backfill_paypal_fees.py index 5bbeadf4..bb47c752 100755 --- a/tools/paypal/oneoff/backfill_paypal_fees.py +++ b/tools/paypal/oneoff/backfill_paypal_fees.py @@ -35,7 +35,7 @@ if __name__ == "__main__": sys.exit(1) # Amounts match, get the fee # For donations, there is no fee and a different xtype - if info['TRANSACTIONTYPE'][0] == 'sendmoney' and not info.has_key('FEEAMT'): + if info['TRANSACTIONTYPE'][0] == 'sendmoney' and 'FEEAMT' not in info: print "%s: Amount %s, donation, no fee" % (ti.paypaltransid, ti.amount) ti.fee = 0 else: |
