From 428d872be7b0896f85dd5bbd83df8a2d2f429b42 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Thu, 3 Sep 2009 00:59:17 -0500 Subject: Updated some python scripts to not use deprecated modules. --- linden/indra/lib/python/indra/base/lluuid.py | 5 +++-- linden/indra/lib/python/indra/ipc/llmessage.py | 6 ++---- linden/scripts/install.py | 6 ++---- 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'linden') diff --git a/linden/indra/lib/python/indra/base/lluuid.py b/linden/indra/lib/python/indra/base/lluuid.py index aceea29..40ce818 100644 --- a/linden/indra/lib/python/indra/base/lluuid.py +++ b/linden/indra/lib/python/indra/base/lluuid.py @@ -26,7 +26,8 @@ THE SOFTWARE. $/LicenseInfo$ """ -import md5, random, socket, string, time, re +import random, socket, string, time, re +from hashlib import md5 import uuid def _int2binstr(i,l): @@ -196,7 +197,7 @@ class UUID(object): from c++ implementation for portability reasons. Returns self. """ - m = md5.new() + m = md5() m.update(uuid.uuid1().bytes) self._bits = m.digest() return self diff --git a/linden/indra/lib/python/indra/ipc/llmessage.py b/linden/indra/lib/python/indra/ipc/llmessage.py index 6161bad..91fb36b 100644 --- a/linden/indra/lib/python/indra/ipc/llmessage.py +++ b/linden/indra/lib/python/indra/ipc/llmessage.py @@ -26,8 +26,6 @@ THE SOFTWARE. $/LicenseInfo$ """ -from sets import Set, ImmutableSet - from compatibility import Incompatible, Older, Newer, Same from tokenstream import TokenStream @@ -44,8 +42,8 @@ class Template: def compatibleWithBase(self, base): messagenames = ( - ImmutableSet(self.messages.keys()) - | ImmutableSet(base.messages.keys()) + frozenset(self.messages.keys()) + | frozenset(base.messages.keys()) ) compatibility = Same() diff --git a/linden/scripts/install.py b/linden/scripts/install.py index f886a6e..3843c83 100755 --- a/linden/scripts/install.py +++ b/linden/scripts/install.py @@ -34,7 +34,7 @@ $/LicenseInfo$ """ import copy -import md5 +from hashlib import md5 import optparse import os import platform @@ -46,8 +46,6 @@ import tempfile import urllib2 import urlparse -from sets import Set as set, ImmutableSet as frozenset - # Locate -our- python library relative to our install location. from os.path import realpath, dirname, join @@ -76,7 +74,7 @@ class InstallFile(object): return "ifile{%s:%s}" % (self.pkgname, self.url) def _is_md5sum_match(self): - hasher = md5.new(file(self.filename, 'rb').read()) + hasher = md5(file(self.filename, 'rb').read()) if hasher.hexdigest() == self.md5sum: return True return False -- cgit v1.1