[scribus-dev] 1.5.6svn and Python3

Craig Bradney cbradney at scribus.info
Fri Nov 1 20:44:45 UTC 2019


Hi Greg

Thats one of the changes in Python 3… 

why “fortunately”? python2 is dead. We no longer support it with 1.5.x and future versions.

Craig

> On 1 Nov 2019, at 9:40 pm, Gregory Pittman <gpittman at iglou.com> wrote:
> 
> One thing I am finding as a common error-generator is in scripts where there is error-checking to see if the script is being run in Scribus, e.g.
> 
> try:
>    import scribus
> except ImportError:
>    print "Unable to import the 'scribus' module. This script will only run within"
>    print "the Python interpreter embedded in Scribus. Try Script->Execute Script."
>    sys.exit(1)
> 
> This generates a syntax error even if you're using the script in Scribus. Python3 requires parentheses to surround the text being printed:
> 
> try:
>    import scribus
> except ImportError:
>    print ("Unable to import the 'scribus' module. This script will only run within")
>    print ("the Python interpreter embedded in Scribus. Try Script->Execute Script.")
>    sys.exit(1)
> 
> Fortunately, Python2 will accept such a command with the parentheses. I'll go through and see which included scripts might have this problem.
> 
> Greg
> 
> _______________________________________________
> scribus-dev mailing list
> scribus-dev at lists.scribus.net
> http://lists.scribus.net/mailman/listinfo/scribus-dev




More information about the scribus-dev mailing list