Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.040 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; '22,': 0.09; 'subject:module': 0.09; 'determining': 0.16; 'subject:created': 0.16; 'unload': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'module': 0.19; 'patrick': 0.19; 'references': 0.26; 'header:In-Reply-To:1': 0.27; 'returned': 0.30; 'message-id:@mail.gmail.com': 0.30; 'subject:skip:i 10': 0.31; 'subject:with': 0.35; 'received:google.com': 0.35; 'nov': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'deleting': 0.60; 'deleted?': 0.84; 'it\xe2\x80\x99s': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=T5x6hLPUBr7db9w/7UYVICXZL1hS1q/z5URTwcA0U/M=; b=K6lJwumOZd/qm2gje1hh6dIZ/JAyXK5wgfS9VuLBd44rFaSP6HGfA7evFZhEv95XYo QXt+i81D3DkNf1yA2iFkCnHB3r71jezzMRBrRycIjM6EVSTSN6t764f3VJIHPTRGM7Ir bW8Fr361oLUsjnXJUlaKX/sNfMmkPosdaMYgt+Ixg6GdWbm3y1Hce1XBzR9X2vgT4xJ2 UUugu1HXOvoArmIKr1/MDel0x8NyY6IgeX7bRtC3Vr3QK3jswEzyEmrICCjuwKIvfC9R n+oR2st2nChu1B9P8UMPQPL4GcpGroMG0w9MCKkIVwsPKEG+/QzBwLfrC1nQrARfj5hY ns7g== X-Received: by 10.70.34.206 with SMTP id b14mr23221415pdj.10.1416736155868; Sun, 23 Nov 2014 01:49:15 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Sun, 23 Nov 2014 02:48:35 -0700 Subject: Re: unloading a module created with imp.new_module To: Python Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416736165 news.xs4all.nl 2847 [2001:888:2000:d::a6]:38682 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3326 X-Received-Body-CRC: 3457824295 Xref: csiph.com comp.lang.python:81352 On Sat, Nov 22, 2014 at 11:49 PM, Patrick Stinson w= rote: > If I create a module with imp.new_module(name), how can I unload it so th= at all the references contained in it are set to zero and the module is del= eted? deleting the reference that is returned doesn=E2=80=99t seem to do th= e job, and it=E2=80=99s not in sys.modules, so where is the dangling refere= nce? How are you determining that the module is not deleted?