mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-05 02:46:10 +02:00
Some more python2.3 support changes
This commit is contained in:
parent
2bacf1a854
commit
848595f49b
2
debian/changelog
vendored
2
debian/changelog
vendored
@ -4,6 +4,8 @@ pgloader (2.3.2-1) unstable; urgency=low
|
||||
* FIX fixedreader: it now know about -C
|
||||
* FIX Round Robin Reader with respect to offsets in readlines()
|
||||
* allow python 2.3 to run pgloader when it does not need collections.deque (no Round Robin Reader)
|
||||
* change logger initialisation to support python 2.3
|
||||
* FIX bad usage of STDERR in the code
|
||||
|
||||
-- Dimitri Fontaine <dim@tapoueh.org> Wed, 17 Sep 2008 17:53:53 +0200
|
||||
|
||||
|
||||
@ -607,15 +607,15 @@ if __name__ == "__main__":
|
||||
try:
|
||||
ret = load_data()
|
||||
except Exception, e:
|
||||
print >>STDERR, e
|
||||
sys.stderr.write(str(e) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
except IOError, e:
|
||||
print >>STDERR, e
|
||||
sys.stderr.write(str(e) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
except KeyboardInterrupt, e:
|
||||
print >>STDERR, e
|
||||
sys.stderr.write(str(e) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
sys.exit(ret)
|
||||
|
||||
@ -20,6 +20,14 @@ def init(client_min_messages = logging.INFO,
|
||||
datefmt = '%d-%m-%Y %H:%M:%S',
|
||||
filename = filename,
|
||||
filemode = 'w')
|
||||
except TypeError:
|
||||
# very old python (2.3 or such) didn't have kwargs in basicConfig
|
||||
logfile = logging.FileHandler(filename, filemode)
|
||||
logfile.setLevel(log_min_messages)
|
||||
logfile_fmt = logging.Formatter(fmt, datefmt)
|
||||
logfile.setFormatter(logfile_fmt)
|
||||
|
||||
logging.getLogger('').addHandler(logfile)
|
||||
except IOError, e:
|
||||
raise PGLoader_Error, e
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user