aboutsummaryrefslogtreecommitdiffstats
path: root/pkg_resources.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-09-18 07:25:45 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-09-18 07:25:45 -0400
commita2201d3d5a74ea034caf2f6eeeb877708e9017bf (patch)
tree9cd1a1854af4b79b0ae3c5de765fec66b6f54ffe /pkg_resources.py
parent8f56e928f03f69a5e787f830c04714467307601e (diff)
downloadexternal_python_setuptools-a2201d3d5a74ea034caf2f6eeeb877708e9017bf.tar.gz
external_python_setuptools-a2201d3d5a74ea034caf2f6eeeb877708e9017bf.tar.bz2
external_python_setuptools-a2201d3d5a74ea034caf2f6eeeb877708e9017bf.zip
next function and io module are available on Python 2.6
Diffstat (limited to 'pkg_resources.py')
-rw-r--r--pkg_resources.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/pkg_resources.py b/pkg_resources.py
index 5dcfd66e..d8c73320 100644
--- a/pkg_resources.py
+++ b/pkg_resources.py
@@ -16,6 +16,7 @@ method.
import sys
import os
+import io
import time
import re
import imp
@@ -46,7 +47,6 @@ if PY2:
if PY3:
basestring = str
- from io import BytesIO
def execfile(fn, globs=None, locs=None):
if globs is None:
globs = globals()
@@ -54,10 +54,6 @@ if PY3:
locs = globs
exec(compile(open(fn).read(), fn, 'exec'), globs, locs)
-if PY2:
- next = lambda o: o.next()
- from cStringIO import StringIO as BytesIO
-
# capture these to bypass sandboxing
from os import utime
try:
@@ -1378,7 +1374,7 @@ class NullProvider:
return self._fn(self.module_path, resource_name)
def get_resource_stream(self, manager, resource_name):
- return BytesIO(self.get_resource_string(manager, resource_name))
+ return io.BytesIO(self.get_resource_string(manager, resource_name))
def get_resource_string(self, manager, resource_name):
return self._get(self._fn(self.module_path, resource_name))