Browse code

use curly set syntax and remove unneeded r for open, warnings from pyupgrade

Hanno Böck authored on10/06/2020 20:09:07
Showing2 changed files
... ...
@@ -19,7 +19,7 @@ class TestJsonLint(unittest.TestCase):
19 19
     def test_json_lint(self):
20 20
         valid = True
21 21
         for f in glob.glob("freewvsdb/*.json"):
22
-            fp = open(f, "r")
22
+            fp = open(f)
23 23
             orig = fp.read()
24 24
             fp.close()
25 25
             tmp = json.loads(orig)
... ...
@@ -36,7 +36,7 @@ class TestJsonLint(unittest.TestCase):
36 36
             with open(cfile) as json_file:
37 37
                 jconfig += json.load(json_file)
38 38
 
39
-        mkeys = set(['name', 'url', 'safe', 'vuln', 'detection'])
39
+        mkeys = {'name', 'url', 'safe', 'vuln', 'detection'}
40 40
         for item in jconfig:
41 41
 
42 42
             # check for all mandatory keys
... ...
@@ -27,7 +27,7 @@ if not target:
27 27
 
28 28
 old = 0
29 29
 if os.path.isfile(target + "timestamp"):
30
-    with open(target + "timestamp", "r") as f:
30
+    with open(target + "timestamp") as f:
31 31
         old = int(f.read())
32 32
 
33 33
 new = int(urllib.request.urlopen(DBURL + "freewvsdb.timestamp").read())