From 6494de7e221cb18d7ccb3a609fd08d39d482c299 Mon Sep 17 00:00:00 2001 From: "U-IBM194-P16TCDD\\liuyug" <liuyug@gmail.com> Date: Wed, 3 Feb 2016 14:51:28 +0800 Subject: [PATCH] Fix pyinstaller pack error --- homedns/adblock.py | 6 +++--- pyinst.cmd | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homedns/adblock.py b/homedns/adblock.py index 260a460..2edffa6 100644 --- a/homedns/adblock.py +++ b/homedns/adblock.py @@ -20,10 +20,10 @@ def get_desc(self, vv): class Adblock(object): def __init__(self, obj): - if isinstance(obj, file): - fobj = obj - else: + if isinstance(obj, str): fobj = open(obj) + else: + fobj = obj self.blacklist = set() self.whitelist = set() for line in iter(fobj.readline, ''): diff --git a/pyinst.cmd b/pyinst.cmd index d3dab05..966b6a7 100644 --- a/pyinst.cmd +++ b/pyinst.cmd @@ -2,5 +2,5 @@ rmdir build /s /q -pyinstaller --clean --noupx -c -F homedns.py +pyinstaller --clean --noupx -c -p homedns -F homedns.py