BrainSpawnInfosphere / pyarchey

Archey is a system information tool written in Python.
https://pypi.python.org/pypi/pyarchey/
GNU General Public License v3.0
8 stars 6 forks source link

NameError: name 'xrange' is not defined #11

Closed rumpelsepp closed 8 years ago

rumpelsepp commented 9 years ago
$ pyarchey -d
Linux
Traceback (most recent call last):
  File "/usr/bin/pyarchey", line 9, in <module>
    load_entry_point('pyarchey==0.6.6', 'console_scripts', 'pyarchey')()
  File "/usr/lib/python3.4/site-packages/pyarchey/pyarchey.py", line 650, in main
    print(logosDict[i].format(color = colorDict[i],results=list(xrange(0,13))) )
NameError: name 'xrange' is not defined
rumpelsepp commented 9 years ago

Just take this patch

diff --git a/pyarchey/pyarchey.py b/pyarchey/pyarchey.py
index e7e6554..4f9b0e8 100755
--- a/pyarchey/pyarchey.py
+++ b/pyarchey/pyarchey.py
@@ -642,7 +642,7 @@ def main():
        if args['display']:
                for i in logosDict:
                        print(i)
-                       print(logosDict[i].format(color = colorDict[i],results=list(xrange(0,13))) )
+                       print(logosDict[i].format(color = colorDict[i],results=list(range(0,13))) )
                return 0

     # Need a good way to display version number, there seems to be no standard
walchko commented 9 years ago

strange .... xrange is part of python. What version of python are you using? Also what operating system and version?

rumpelsepp commented 9 years ago

Not in Python 3.4: http://stackoverflow.com/questions/15014310/why-is-there-no-xrange-function-in-python3

walchko commented 8 years ago

Ah ... I don't use python 3 nor do I test against it. Either way, I don't think there is an issue between xrange and range. No problem, I will double check it and make the update this weekend ... thanks!

walchko commented 8 years ago

Should be good now ... thanks again!