Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 903d620

Browse files
author
Jared Manning
committed
Remove unecessary line and variable
Line 21. Combined open() with read() in one line, saving a variable and a line
1 parent 0f47eb3 commit 903d620

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

check_for_sqlite_files.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Script Name : check_for_sqlite_files.py
22
# Author : Craig Richards
33
# Created : 07 June 2013
4-
# Last Modified :
5-
# Version : 1.0
4+
# Last Modified : 14 February 2016
5+
# Version : 1.0.1
66

7-
# Modifications :
7+
# Modifications : 1.0.1 - Remove unecessary line and variable on Line 21
88

99
# Description : Scans directories to check if there are any sqlite files in there
1010

@@ -18,8 +18,7 @@ def isSQLite3(filename):
1818
if getsize(filename) < 100: # SQLite database file header is 100 bytes
1919
return False
2020
else:
21-
fd = open(filename, 'rb')
22-
Header = fd.read(100)
21+
Header = open(filename, 'rb').read(100)
2322
fd.close()
2423

2524
if Header[0:16] == 'SQLite format 3\000':

0 commit comments

Comments
 (0)