This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author markus_gritsch
Recipients
Date 2004-10-25.09:06:43
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The following short script produces a "SyntaxWarning:
name 'cPickle' is assigned to before global
declaration", which is IMO not correct.


mode = 'pickle'

def main():
    if mode == 'pickle':
        global cPickle
        import cPickle
    elif mode == 'socket':
        global cPickle, socket
        import cPickle, socket
    elif mode == 'sqlite':
        global sqlite
        import sqlite
    else:
        print 'Warning: Unknown mode.'

def test():
    print cPickle.__doc__

if __name__ == '__main__':
    main()
    test()
History
Date User Action Args
2007-08-23 14:26:59adminlinkissue1053604 messages
2007-08-23 14:26:59admincreate