Browse Source

parse comment

var 'rows' not init before return
dev
破娃酱 8 years ago
parent
commit
d968f01245
  1. 2
      db_transfer.py
  2. 2
      shadowsocks/asyncdns.py

2
db_transfer.py

@ -550,8 +550,8 @@ class Dbv3Transfer(DbTransfer):
cur = conn.cursor() cur = conn.cursor()
try: try:
cur.execute("SELECT " + ','.join(keys) + " FROM user")
rows = [] rows = []
cur.execute("SELECT " + ','.join(keys) + " FROM user")
for r in cur.fetchall(): for r in cur.fetchall():
d = {} d = {}
for column in range(len(keys)): for column in range(len(keys)):

2
shadowsocks/asyncdns.py

@ -331,6 +331,8 @@ class DNSResolver(object):
with open(etc_path, 'rb') as f: with open(etc_path, 'rb') as f:
for line in f.readlines(): for line in f.readlines():
line = line.strip() line = line.strip()
if "#" in line:
line = line[:line.find('#')]
parts = line.split() parts = line.split()
if len(parts) >= 2: if len(parts) >= 2:
ip = parts[0] ip = parts[0]

Loading…
Cancel
Save