SpockBotMC / SpockBot

High level Python framework for building Minecraft clients and bots.
MIT License
198 stars 47 forks source link

SyntaxError: invalid syntax (mcdata.py) #41

Closed ghost closed 9 years ago

ghost commented 9 years ago

CentOS 6.5

CPU Model: Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz

[root@server SpockBot-master]# python demo.py Traceback (most recent call last): File "demo.py", line 5, in from spock import Client File "/home/SpockBot-master/spock/init.py", line 1, in from spock.plugins.pluginloader import PluginLoader File "/home/SpockBot-master/spock/plugins/init.py", line 1, in from spock.plugins.core import event, net, auth, timer, ticker File "/home/SpockBot-master/spock/plugins/core/event.py", line 7, in from spock.mcp import mcdata File "/home/SpockBot-master/spock/mcp/mcdata.py", line 1133 for state in packet_structs ^ SyntaxError: invalid syntax

(None of the files were modified.)

nickelpro commented 9 years ago

Python version? Spock only supports Python2.7+ and I have a feeling CentOS is on 2.6

nickelpro commented 9 years ago

Ya, it's a dictionary comprehension issue, a feature that was introduced in 2.7: https://www.python.org/dev/peps/pep-0274/

I won't close until its confirmed but I'm 95% this is an unsupported Python version

ghost commented 9 years ago

I see. I've just checked my Python version and it is 2.6.6. Sorry for bothering you in that case. I'll try to update my Python.

import sys print (sys.version) 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]

ghost commented 9 years ago

Just tried this on a CentOS VPS with Python 2.7.7 and it worked beautifully. Thank you for all your work.