Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion source/compoundDocuments.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,13 @@ def compareEndPoints(self, other, which):
return selfTi.compareEndPoints(otherTi, which)

# Different objects, so we have to compare the hierarchical positions of the objects.
return cmp(self._getObjectPosition(selfObj), other._getObjectPosition(otherObj))
# cmp no longer exists in Python3.
# Per the Python3 What's New docs:
# cmp can be replaced with (a>b)-(a<b).
# In other words, False and True coerce to 0 and 1 respectively.
selfPosition=self._getObjectPosition(selfObj)
otherPosition=other._getObjectPosition(otherObj)
return (selfPosition>otherPosition)-(selfPosition<otherPosition)

def expand(self, unit):
if unit == textInfos.UNIT_READINGCHUNK:
Expand Down
10 changes: 7 additions & 3 deletions source/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,15 @@ def comparePreviousInstall():
if not path or not os.path.isdir(path):
return None
try:
return cmp(
os.path.getmtime(os.path.join(path, "nvda_slave.exe")),
os.path.getmtime("nvda_slave.exe"))
oldTime=os.path.getmtime(os.path.join(path, "nvda_slave.exe"))
newTime=os.path.getmtime("nvda_slave.exe")
except OSError:
return None
# cmp no longer exists in Python3.
# Per the Python3 What's New docs:
# cmp can be replaced with (a>b)-(a<b).
# In other words, False and True coerce to 0 and 1 respectively.
return (oldTime>newTime)-(oldTime<newTime)

def getDocFilePath(fileName,installDir):
rootPath=os.path.join(installDir,'documentation')
Expand Down