Skip to content

Commit

Permalink
fix #71 SyntaxWarnings with Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ikirudennis committed Jan 25, 2020
1 parent 4fcf8e7 commit 55dfbc6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions textile/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def markStartOfLinks(self, text):
linkparts = []
i = 0

while balanced is not 0 or i is 0: # pragma: no branch
while balanced != 0 or i == 0: # pragma: no branch
# Starting at the end, pop off the previous part of the
# slice's fragments.

Expand All @@ -736,7 +736,7 @@ def markStartOfLinks(self, text):
# HAL!"":url... In this case we count a zero length in
# the last position as a closing quote and others as
# opening quotes.
if i is 0:
if i == 0:
balanced = balanced + 1
else:
balanced = balanced - 1
Expand All @@ -751,7 +751,7 @@ def markStartOfLinks(self, text):
break
# If the next possibility is empty or ends in a space
# we have a closing ".
if (possibility is '' or possibility.endswith(' ')):
if (possibility == '' or possibility.endswith(' ')):
# force search exit
balanced = 0;

Expand Down Expand Up @@ -1398,7 +1398,7 @@ def retrieveURLs(self, text):

def retrieveURL(self, match):
url = self.refCache.get(int(match.group('token')), '')
if url is '':
if url == '':
return url

if url in self.urlrefs:
Expand Down

0 comments on commit 55dfbc6

Please sign in to comment.