Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit b5cd481

Browse files
committed
Python 3.8 needed SyntaxWarning fixes - as annoying as that was!
1 parent d76dd70 commit b5cd481

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

CloudFlare/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
""" Cloudflare v4 API"""
22
from __future__ import absolute_import
33

4-
__version__ = '2.4.0'
4+
__version__ = '2.4.1'
55

66
from .cloudflare import CloudFlare
77

CloudFlare/cloudflare.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,11 +836,11 @@ def __init__(self, email=None, token=None, certtoken=None, debug=False, raw=Fals
836836
if certtoken is None:
837837
certtoken = conf_certtoken
838838

839-
if email is '':
839+
if email == '':
840840
email = None
841-
if token is '':
841+
if token == '':
842842
token = None
843-
if certtoken is '':
843+
if certtoken == '':
844844
certtoken = None
845845
self._base = self._v4base(email, token, certtoken, base_url, debug, raw, use_sessions)
846846

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,8 @@ As of January 2020 the code is Python3 clean.
10131013

10141014
As of January 2020 the code is shipped up to pypi with Python2 support removed.
10151015

1016+
As of January 2020 the code is Python3.8 clean. The new `SyntaxWarning` messages (i.e. `SyntaxWarning: "is" with a literal. Did you mean "=="?`) meant minor edits were needed.
1017+
10161018
## Credit
10171019

10181020
This is based on work by [Felix Wong (gnowxilef)](https://github.com/gnowxilef) found [here](https://github.com/cloudflare-api/python-cloudflare-v4).

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,11 @@ As of January 2020 the code is Python3 clean.
11871187
As of January 2020 the code is shipped up to pypi with Python2 support
11881188
removed.
11891189

1190+
As of January 2020 the code is Python3.8 clean. The new
1191+
``SyntaxWarning`` messages (i.e.
1192+
``SyntaxWarning: "is" with a literal. Did you mean "=="?``) meant minor
1193+
edits were needed.
1194+
11901195
Credit
11911196
------
11921197

cli4/cli4.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,27 +122,27 @@ def run_command(cf, method, command, params=None, content=None, files=None):
122122
identifier2 = [None]
123123
for i2 in identifier2:
124124
try:
125-
if method is 'GET':
125+
if method == 'GET':
126126
r = m.get(identifier1=identifier1,
127127
identifier2=i2,
128128
identifier3=identifier3,
129129
params=params)
130-
elif method is 'PATCH':
130+
elif method == 'PATCH':
131131
r = m.patch(identifier1=identifier1,
132132
identifier2=i2,
133133
identifier3=identifier3,
134134
data=params)
135-
elif method is 'POST':
135+
elif method == 'POST':
136136
r = m.post(identifier1=identifier1,
137137
identifier2=i2,
138138
identifier3=identifier3,
139139
data=params, files=files)
140-
elif method is 'PUT':
140+
elif method == 'PUT':
141141
r = m.put(identifier1=identifier1,
142142
identifier2=i2,
143143
identifier3=identifier3,
144144
data=params)
145-
elif method is 'DELETE':
145+
elif method == 'DELETE':
146146
r = m.delete(identifier1=identifier1,
147147
identifier2=i2,
148148
identifier3=identifier3,
@@ -298,13 +298,13 @@ def do_it(args):
298298
value = False
299299
elif value_string == '' or value_string.lower() == 'none':
300300
value = None
301-
elif value_string[0] is '=' and value_string[1:] == '':
301+
elif value_string[0] == '=' and value_string[1:] == '':
302302
exit('cli4: %s== - no number value passed' % (tag_string))
303-
elif value_string[0] is '=' and digits_only.match(value_string[1:]):
303+
elif value_string[0] == '=' and digits_only.match(value_string[1:]):
304304
value = int(value_string[1:])
305-
elif value_string[0] is '=' and floats_only.match(value_string[1:]):
305+
elif value_string[0] == '=' and floats_only.match(value_string[1:]):
306306
value = float(value_string[1:])
307-
elif value_string[0] is '=':
307+
elif value_string[0] == '=':
308308
exit('cli4: %s== - invalid number value passed' % (tag_string))
309309
elif value_string[0] in '[{' and value_string[-1] in '}]':
310310
# a json structure - used in pagerules
@@ -315,7 +315,7 @@ def do_it(args):
315315
value = yaml.safe_load(value_string)
316316
except ValueError:
317317
exit('cli4: %s="%s" - can\'t parse json value' % (tag_string, value_string))
318-
elif value_string[0] is '@':
318+
elif value_string[0] == '@':
319319
# a file to be uploaded - used in dns_records/import - only via POST
320320
filename = value_string[1:]
321321
if method != 'POST':

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def main():
5151
'Programming Language :: Python :: 3.5',
5252
'Programming Language :: Python :: 3.6',
5353
'Programming Language :: Python :: 3.7'
54+
'Programming Language :: Python :: 3.8'
5455
]
5556
)
5657

0 commit comments

Comments
 (0)