diff options
Diffstat (limited to 'Demo')
-rwxr-xr-x | Demo/classes/Range.py | 6 | ||||
-rw-r--r-- | Demo/imputil/knee.py | 6 | ||||
-rwxr-xr-x | Demo/pdist/client.py | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Demo/classes/Range.py b/Demo/classes/Range.py index 0f84157..a0cef74 100755 --- a/Demo/classes/Range.py +++ b/Demo/classes/Range.py @@ -64,9 +64,9 @@ class oldrange: def test(): - import time, __builtin__ + import time, builtins #Just a quick sanity check - correct_result = __builtin__.range(5, 100, 3) + correct_result = builtins.range(5, 100, 3) oldrange_result = list(oldrange(5, 100, 3)) genrange_result = list(genrange(5, 100, 3)) if genrange_result != correct_result or oldrange_result != correct_result: @@ -81,7 +81,7 @@ def test(): for i in genrange(1000): pass t3 = time.time() - for i in __builtin__.range(1000): + for i in builtins.range(1000): pass t4 = time.time() print(t2-t1, 'sec (old-style class)') diff --git a/Demo/imputil/knee.py b/Demo/imputil/knee.py index 49fdf2b..435b51c 100644 --- a/Demo/imputil/knee.py +++ b/Demo/imputil/knee.py @@ -7,7 +7,7 @@ This code is intended to be read, not executed. However, it does work """ -import sys, imp, __builtin__ +import sys, imp, builtins # Replacement for __import__() @@ -117,7 +117,7 @@ def reload(module): # Save the original hooks -original_import = __builtin__.__import__ +original_import = builtins.__import__ # Now install our hooks -__builtin__.__import__ = import_hook +builtins.__import__ = import_hook diff --git a/Demo/pdist/client.py b/Demo/pdist/client.py index 13158f2..c9fe369 100755 --- a/Demo/pdist/client.py +++ b/Demo/pdist/client.py @@ -3,7 +3,7 @@ import sys import socket import pickle -import __builtin__ +import builtins import os @@ -90,8 +90,8 @@ class Client: if exception is None: return value x = exception - if hasattr(__builtin__, exception): - x = getattr(__builtin__, exception) + if hasattr(builtins, exception): + x = getattr(builtins, exception) elif exception in ('posix.error', 'mac.error'): x = os.error if x == exception: |