Skip to content

Commit 9aca0ff

Browse files
Merge pull request #435 from huisman/small_fixes
Remove unused import and fix None singleton compare
2 parents 436d5c3 + a37027d commit 9aca0ff

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

tika/parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#
1818

1919
from .tika import parse1, callServer, ServerEndpoint
20-
import os
2120
import json
2221

2322
def from_file(filename, serverEndpoint=ServerEndpoint, service='all', xmlContent=False, headers=None, config_path=None, requestOptions={}, raw_response=False):
@@ -86,7 +85,7 @@ def _parse(output, service='all'):
8685
return parsed
8786

8887
parsed["status"] = output[0]
89-
if output[1] == None or output[1] == "":
88+
if output[1] is None or output[1] == "":
9089
return parsed
9190

9291
if service == "text":

tika/tika.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def runCommand(cmd, option, urlOrPaths, port, outDir=None,
219219
:return: response for the command, usually a ``dict``
220220
'''
221221
# import pdb; pdb.set_trace()
222-
if (cmd in 'parse' or cmd in 'detect') and (urlOrPaths == [] or urlOrPaths == None):
222+
if (cmd in 'parse' or cmd in 'detect') and (urlOrPaths == [] or urlOrPaths is None):
223223
log.exception('No URLs/paths specified.')
224224
raise TikaException('No URLs/paths specified.')
225225
serverEndpoint = 'http://' + serverHost + ':' + port

0 commit comments

Comments
 (0)