public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/antlr3] epel10: - Patch the Python runtime to print just a warning in case of version
Date: Wed, 22 Jul 2026 19:37:06 GMT [thread overview]
Message-ID: <178474902675.1.16209797231590549927.rpms-antlr3-32c82cb3a1ac@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/antlr3
Branch : epel10
Commit : 32c82cb3a1ac443d906ecea8e54e5bcb5711198e
Author : Miloš Jakubíček <mjakubicek@fedoraproject.org>
Date : 2010-05-01T12:02:41+00:00
Stats : +45/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/antlr3/c/32c82cb3a1ac443d906ecea8e54e5bcb5711198e?branch=epel10
Log:
- Patch the Python runtime to print just a warning in case of version
mismatch instead of raising an exception (since there is a good change
it will work).
---
diff --git a/antlr-python-3.1.2-version.patch b/antlr-python-3.1.2-version.patch
new file mode 100644
index 0000000..ee9800c
--- /dev/null
+++ b/antlr-python-3.1.2-version.patch
@@ -0,0 +1,37 @@
+--- antlr_python_runtime-3.1.2/antlr3/recognizers.py.orig 2010-05-01 13:30:01.000000000 +0200
++++ antlr_python_runtime-3.1.2/antlr3/recognizers.py 2010-05-01 13:36:00.000000000 +0200
+@@ -164,24 +164,20 @@
+ self._state = state
+
+ if self.antlr_version > runtime_version:
+- raise RuntimeError(
+- "ANTLR version mismatch: "
+- "The recognizer has been generated by V%s, but this runtime "
+- "is V%s. Please use the V%s runtime or higher."
+- % (self.antlr_version_str,
+- runtime_version_str,
+- self.antlr_version_str))
++ print >> sys.stderr, """
++ WARNING: ANTLR version mismatch:
++ The recognizer has been generated by V%s, but this runtime
++ is V%s, this may not work correctly. Please use the V%s runtime or higher.""" % (
++ self.antlr_version_str, runtime_version_str, self.antlr_version_str)
+ elif (self.antlr_version < (3, 1, 0, 0) and
+ self.antlr_version != runtime_version):
+ # FIXME: make the runtime compatible with 3.0.1 codegen
+ # and remove this block.
+- raise RuntimeError(
+- "ANTLR version mismatch: "
+- "The recognizer has been generated by V%s, but this runtime "
+- "is V%s. Please use the V%s runtime."
+- % (self.antlr_version_str,
+- runtime_version_str,
+- self.antlr_version_str))
++ print >> sys.stderr, """
++ WARNING ANTLR version mismatch:
++ The recognizer has been generated by V%s, but this runtime
++ is V%s, this may not work correctly. Please use the V%s runtime.""" % (
++ self.antlr_version_str, runtime_version_str, self.antlr_version_str)
+
+ # this one only exists to shut up pylint :(
+ def setInput(self, input):
diff --git a/antlr3.spec b/antlr3.spec
index 66b4759..2f2ce10 100644
--- a/antlr3.spec
+++ b/antlr3.spec
@@ -9,7 +9,7 @@
Summary: ANother Tool for Language Recognition
Name: antlr3
Version: %{antlr_version}
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: http://www.antlr.org/
Source0: http://www.antlr.org/download/antlr-%{antlr_version}.tar.gz
Source1: http://www.antlr.org/download/C/libantlr3c-%{antlr_version}.tar.gz
@@ -23,6 +23,8 @@ Source8: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/antlr/antlr3-maven-
%endif
# No buildnumber and findbugs:
Patch0: antlr-pom.patch
+# Python version mismatch patch, to be possibly upstreamed:
+Patch1: antlr-python-3.1.2-version.patch
License: BSD
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{antlr_version}-%{release}-root-%(%{__id_u} -n)
@@ -146,6 +148,7 @@ Python run-time support for ANTLR-generated parsers
%prep
%setup -q -n antlr-%{antlr_version} -a 1 -a 2 -a 3
%patch0 -b .orig
+%patch1 -b .orig
%if %{with_bootstrap}
cp %{SOURCE6} settings.xml
%endif
@@ -321,6 +324,10 @@ rm -rf $RPM_BUILD_ROOT
%{_mavenpomdir}/JPP-maven-gunit-plugin.pom
%changelog
+* Sat May 01 2010 Miloš Jakubíček <xjakub@fi.muni.cz> - 3.2-6
+- Patch the Python runtime to print just a warning in case of version mismatch
+ instead of raising an exception (since there is a good change it will work).
+
* Thu Apr 22 2010 Miloš Jakubíček <xjakub@fi.muni.cz> - 3.2-5
- Build the C runtime with --enable-64bit on x86_64 to avoid undeterministic
segfaults caused by possible invalid conversion of 64bit pointers to int32_t
reply other threads:[~2026-07-22 19:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178474902675.1.16209797231590549927.rpms-antlr3-32c82cb3a1ac@fedoraproject.org \
--to=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox